This week's book giveaway is in the Agile and other Processes forum. We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line! See this thread for details.
Can someone guide me to tutorial or material which shows how to include a dynamic input Text field in jsf 2 xhtml when "add" button is clicked?..... number of textfield can vary from 0 - any(1/3/11/20.......) I am thinking to use hashmap to collect data from view but main point is how can i create dynamic UIcomponent?
Please guide me to some proper turtorial or some material
Nikita Sinha wrote:can anyone help me on my problem?
No until you can explain it more clearly.
Am I understanding that you want to keep an array of textfield controls on your page and be able to add another control each time a button is clicked?
One of the simplest ways to do that is to define a dataTable with a row definition containing a textinput control. To add more controls, add more rows to the DataModel that backs the dataTable. JSF will do the rest automatically and you won't have to mess around with UIComponents at all.
Customer surveys are for companies who didn't pay proper attention to begin with.
Marco Noronha
Ranch Hand
Joined: Oct 30, 2012
Posts: 50
posted
0
Tim Holloway wrote:One of the simplest ways to do that is to define a dataTable with a row definition containing a textinput control. To add more controls, add more rows to the DataModel that backs the dataTable. JSF will do the rest automatically and you won't have to mess around with UIComponents at all.
Do you have an example of what your saying?
I´m trying to build a fake dynamic form.
I mean, I change the rendered value and update the form component with ajax.
But not working. Can you help me out?