When I ran the application, I can see only the headers of the datatable. I could not see any values.
Have anyone tried this, let me know.
A. Dusi
Ranch Hand
Joined: Sep 27, 2004
Posts: 114
posted
0
I had a similar requirement in my project and in addition, each datatable had different number of columns. I solved this by nested datatables approach. My JSF implementation was MyFaces and Tomahawk. So if you are flexible using these implementations, have a look at t:dataList, t:datatable, t:columns and t:column components.
Mark Robert
Greenhorn
Joined: Oct 04, 2007
Posts: 3
posted
0
Originally posted by A. Dusi: I had a similar requirement in my project and in addition, each datatable had different number of columns. I solved this by nested datatables approach. My JSF implementation was MyFaces and Tomahawk. So if you are flexible using these implementations, have a look at t:dataList, t:datatable, t:columns and t:column components.
Hi Dusi, Thanks to your reply. Can you post a template code of .java and .jsp.
Regards, Mark.
A. Dusi
Ranch Hand
Joined: Sep 27, 2004
Posts: 114
posted
0
Have a look at the example here. This has the source code for java and jsp. The example given is for dynamic number of columns. You may extend this example in conjunction with a dataList component to get the dynamic tables with dynamic columns.
Actually if you do not need dynamic columns, the solution is simple with no need of t:columns complexity: In your backing bean, make a list of all result sets(table data). In your jsp, use t:dataList (or even h:datatable I think) to loop through that list and display each result set in a h:dataTable. You may also consider using a simple class to hold each table description and its resultSet and making a list of these objects instead of list of result sets. In your jsp you can now display the table description also.
The above code is from here. Lets say each country object has a name and datatable of states. Then, the code in bold font can be something like this:
Hope this helps.. [ October 09, 2007: Message edited by: A. Dusi ]
Mark Robert
Greenhorn
Joined: Oct 04, 2007
Posts: 3
posted
0
Thanks Dusi.
If there is any other issue related to this, I will post. Otherwise, Thanks again.
Mark.
Gopu Akraju
Ranch Hand
Joined: Jan 13, 2008
Posts: 239
posted
0
Hi I am also facing a very similar situation, where I am supposed to get the info from the user about the "number of columns" and generate one table with that many number of columns(rows are fixed). I am new to programming. The link you have given in that message doesn't work now. It would be really useful if you can send me some sample jsp and java files. Thanks and Regards Lilly