views:

244

answers:

2

HI,

suppose i have one input box which takes value for mobile no. and when the user wants to add another mobile no at that time user will click 'plus' button. as soon as he clicks the plus button another text box should appear and user should allow to enter another mobile number i want code in JSF richfaces please help me out.

Thanks in advance Jungle_Hacker

+1  A: 

You can instantiated components in a managed bean of yours. For example:

<a4j:commandButton value="+" action="#{yourBean.addCheckbox}" />

and in your bean something like:

public void addCheckbox() {
     HtmlCheckBox checkBox = new HtmlCheckBox();
     parent.getChildren().add(checkBox); // parent is, for ex. HtmlPanelGroup
}
Bozho
+2  A: 

Make use of rich:dataTable or rich:dataList to iterate over an array or collection, displaying an input box on every iteration. The plus button should add a new item to the array or collection everytime and rerender the table or list.

BalusC
thank you i think its a better idea
Jungle_hacker