Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How we add multiple Row input using dataTable in JSF

 
Vimal Bharathi Andiappan
Greenhorn
Posts: 7
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When we click the add button then new row wants to create that one also used to get the user information. For that how we a code for that.

Example, a user wants to enter set of Username and phone no. Initially the page display 5 rows after clicking the new button then one more row wants to add .

For this add button code i tried but i not get it. Any body knows that please give reply
 
Darryl Nortje
Ranch Hand
Posts: 140
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Vimal,

This is done quite easily. Firstly, there is no need to have 5 empties, and then add one, although you can do that if you want, it'll just require some double checking on the server side, as to which rows are in fact filled in.

But this is what you do basically.

Use a dataTable in your jsp. For each row, have input elements. The dataTable can point to a List on your bean that can contain 1 empty object, say User object.

Have a commandButton that adds an empty User object to this list. That will in essence add a new row to your dataTable.

Then finally a "batch" Add all button that just goes through all the User objects in the list adding each one as necessary.
 
Vimal Bharathi Andiappan
Greenhorn
Posts: 7
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I do the same thing, but it wont work.Anybody having souce code for this example
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic