• Post Reply Bookmark Topic Watch Topic
  • New Topic

Dynamic Textfield In JSF 2.0

 
Abhinay Agarwal
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hey I am using the following code to create the number of text fields as the user wants



The managed bean news has a class News as




The NewsVO is just a javaBean class as follows






The problem is the values inside the input Text doesn't get reflected on pressing the save button. It gives me null, even though, I have written something inside all the textfields.



 
Tim Holloway
Bartender
Posts: 18408
58
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Instead of using ui:repeat, I recommend using the h:dataTable for stuff like this. If you wrap the List in a JSF ListDataModel object and use that as the value attribute of the dataTable element, you will have set up an environment where when you click on a commandButton or commandLink in a row in the table, the command's associated action method can query the DataModel to determine which row was selected.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!