• Post Reply Bookmark Topic Watch Topic
  • New Topic

edit, delete, clear

 
Ravi Thumma
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all

How can I Edit, Delete and Clear records using JSF datatable. Can any one please explain me with examples. I can display the data from database but cannot understand how to edit, delete, clear the data.

Thanks in advance.
 
Rorco Reggz
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
AFAIK, you'll have to implement this functionality yourself. You can find a simple example in the source code that comes with Core JSF book. You can download it from: http://horstmann.com/corejsf/ DataTable examples are inside the ch5 folder. Good luck!
 
Tim Holloway
Bartender
Posts: 18408
58
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
JSF dataTable is a view of a JSF DataModel. The JSF Data Model is simply a data structure designed to house elements for the view (dataTable) to present to the user.

JSF doesn't provide any persistence storage support or CRUD operations itself. The data model itself, in fact, is read-only from the view perspective, although when wraps a collection, you can use the standard collection methods to modify the underlying collection object. That collection may, if you choose, be a direct domain model where the collection operations can then be reflected back into persistent store.
 
Ravi Thumma
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Tim & Rorco Thanks for your help.
Ravi
 
Smitha H Rao
Ranch Hand
Posts: 50
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
For my project I have done it.
The design is to display data in h:datatable and allowing the user to select a row. When the row is selected, the record values would appear in the textfields outside the datatable for edit. User can edit and save the data or delete it.
Simlarly user can add a new row to the datatable.
If you are expecting some functionality like this, I can explain you using the code.

Thanks
Smitha
 
Ravi Thumma
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Smitha
I need your explanation.
Could you please help me in this regard.
Thnak You.
 
Smitha H Rao
Ranch Hand
Posts: 50
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


Go through the blog:
http://www.skill-guru.com/blog/2009/08/20/edit-delete-and-clear-records-using-jsf-datatable/

I have explained it here with code.

Thanks
Smitha
 
Ravi Thumma
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Smitha
It's a great explanation
Thanks a Lot.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!