• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Data table with empty data and fixed size.

 
Janardhan Chowdary
Greenhorn
Posts: 15
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Friends,
I need to implement a data table by using primefaces.
The table should not contain any data initially and some empty rows should be there.
And the rows are able to edit and save.

Thank you,
Janardhan
 
Tim Holloway
Saloon Keeper
Pie
Posts: 18212
53
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the JavaRanch, Janardhan!

The UI view of the dataTable reflects the contents of that dataTable's corresponding DataModel object. Therefore to display a table with a fixed number of empty rows, you must create a DataModel that contains that number of empty row model objects.

If you wish to edit/save rows, do not take the common shortcut of using a Collection or array as a DataModel. Use an actual javax.faces.DataModel class object such as a ListDataModel or ArrayDataModel. The DataModel classes decorate the underlying data with extra location information that permits the action logic to know which row the user is acting on.
 
Janardhan Chowdary
Greenhorn
Posts: 15
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Tim,

Thanks for your quick response with a better solution.

Have a nice day!

Regards,
Janardhan
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic