Meaningless Drivel is fun!*
The moose likes JSF and the fly likes JSF dataTable Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "JSF dataTable" Watch "JSF dataTable" New topic
Author

JSF dataTable

Supriya Pramod
Greenhorn

Joined: Jun 19, 2008
Posts: 10

Can i explicitly add a row in dataTable.
For example , if the dataTable loads two rows from the backing bean , can i insert the third row explicitly

Thanks,
Supriya
Srinivas Krishnamoorthy
Greenhorn

Joined: Jul 28, 2008
Posts: 5
No.

We can only add rows to the datatable from the pagebean.

You can add an empty item in the List (an empty map for example) to the list which is bound to the data table.

Regards,
Srinivas
Supriya Pramod
Greenhorn

Joined: Jun 19, 2008
Posts: 10

I have made one of the columns in the table as a link and when i click , i need to get a iframe exactly below that row. Do you have any idea about how to do this or any other alternative way.

Thanks,
Supriya
Srinivas Krishnamoorthy
Greenhorn

Joined: Jul 28, 2008
Posts: 5
If you want to add another row in the table, you can use the getRowData method of HtmlDataTable to get the row which is cliked and insert a new row in the list of the datatable below the current row.

About iframe : HtmlDataTable doesn't allow any HTML content inside it, so try to enclose you HTML code in f:verbatim tag.
Jerwin Louise Uy
Ranch Hand

Joined: Oct 27, 2007
Posts: 75
If you are asking if you can dynamically add components to the current HtmlDataTable then the answer is yes.

If simply want to alter the number of rows without altering the format of the data table, then you can either bind the HtmlDataTable to a backing bean and change the value property or have a property wired to the value attribute of the HtmlDataTable.

If you want to dynamically alter the child components of a specific UIColumn bound to a HtmlDataTable and add an iframe, you have to create a custom component that simulates all the functions of an iframe and simply add the component as a child component of a UIColumn.

Regards.


Uy Jerwin Louise Vergara
Junior Developer / Research and Development at Incuventure Partners Corporation
email: jerwin.uy@incuventure.net
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JSF dataTable
 
Similar Threads
Adding a row in datatable using dojo
Adding a Datatable as a row in another Datatable
how to get index value of datatable
getting object instance inside nested h:dataTable
calling action method on data table row click