This week's book giveaway is in the Design forum.
We're giving away four copies of Building Microservices and have Sam Newman on-line!
See this thread for details.
The moose likes JSF and the fly likes Data table with empty data and fixed size. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Building Microservices this week in the Design forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "Data table with empty data and fixed size." Watch "Data table with empty data and fixed size." New topic
Author

Data table with empty data and fixed size.

Janardhan Chowdary
Greenhorn

Joined: May 21, 2012
Posts: 15

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


He who cannot obey himself will be commanded. That is the nature of living creatures.
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 17039
    
  26

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.


An IDE is no substitute for an Intelligent Developer.
Janardhan Chowdary
Greenhorn

Joined: May 21, 2012
Posts: 15

Hi Tim,

Thanks for your quick response with a better solution.

Have a nice day!

Regards,
Janardhan
 
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com
 
subject: Data table with empty data and fixed size.
 
jQuery in Action, 3rd edition