Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
The moose likes JSF and the fly likes Dynamic dataTable Using JSF Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "Dynamic dataTable Using JSF" Watch "Dynamic dataTable Using JSF" New topic
Author

Dynamic dataTable Using JSF

Ravi Jagtap
Greenhorn

Joined: May 23, 2006
Posts: 10
Hi,

I want to create a JSF dataTable at runtime. is there any method to do it.
Thanks in adv....
Jamie Williams
Ranch Hand

Joined: Mar 31, 2006
Posts: 70
What exactly do you mean by 'at runtime'?
Ravi Jagtap
Greenhorn

Joined: May 23, 2006
Posts: 10
what i am doing is
i am fetching the number of employee list from one table.
and their details from another table.
so depending on the number of employees in the table i am showing their details in datatable.
so the no. of datatables will be equal to the number of employees in the database. and this number is decided when i run the application.
hope u will get it...

thanks Jamie
Jamie Williams
Ranch Hand

Joined: Mar 31, 2006
Posts: 70
Ok so you want a dataTable for each employee's details, right? I haven't used them myself but I think what you're looking for is nested dataTables.
Daniel Prene
Ranch Hand

Joined: Jul 15, 2005
Posts: 241
and you will need to know which employee is currently being accessed in each iteration? I wrote a grid that has a dynamic number of columns filled with data for each row. What component library are you using? Perhaps I can help you.
Ravi Jagtap
Greenhorn

Joined: May 23, 2006
Posts: 10
Hi

i am using "Sun Java Studio Creator Built-in Components" standard DataTable
let me make it more clear.
as i am fetching the employee and his details from the database..
i am showing this in the datatable so that the employee name will be the title of the table and the table data will be the details of the employee
and so on for the next employee..
Thanks for the replys.....
[ June 09, 2006: Message edited by: Ravi Jagtap ]
Andrew Hair
Greenhorn

Joined: Jun 06, 2006
Posts: 2
Have you found an answer to your problem? I'm having a similar problem and am looking for the solution. Thanks.
omkar patkar
Ranch Hand

Joined: Aug 25, 2005
Posts: 231
Hi guys,
Even i am having a similar problem, the problem is of MASTER-CHILD tables in the database. I am using ibatis to communicate with database and populate the beans. The scenario is as follows :-

I have two Tables :-
Roles and Nominees. The Roles is master table and the Nominees is the child table. There are many nominees for one role. Following are the attributes of the table :-



Now i want to display all the records from these two tables in frontend as follows :-

----------------------------------------------------------------
Role Treasurer (role id 1)
----------------------------------------------------------------
Nominee 1
Nominee 2
Nominee 3
Nominee 4
----------------------------------------------------------------
Role Chairman (role id 2)
----------------------------------------------------------------
Nominee 5
Nominee 6
Nominee 7
Nominee 9
----------------------------------------------------------------
Role Treasurer (role id 2)
----------------------------------------------------------------
Nominee 8
Nominee 12
Nominee 13
Nominee 25
----------------------------------------------------------------


I am really stuck up on how i can display this kind of output on the front end ! ..Some body please please please Help me !! please help me !

Thanks
Omkar patkar !


Thanks and Regards
Omkar Patkar (SCJP 1.4)[url]http://javacollectionsnotes.blogspot.com[/url] | [url]http://omkar-myscjpexp.blogspot.com[/url]
Bauke Scholtz
Ranch Hand

Joined: Oct 08, 2006
Posts: 2458
Nest two datatables.
Jay-ar Bautista
Greenhorn

Joined: Apr 15, 2010
Posts: 1
Bauke Scholtz wrote:Nest two datatables.


Hi Bauke,

I have the same problem. I have two tables: inv_item_tbl(list of item) and serial_tbl(list of serial), in every item there are many serial.
These are the attributes of the table:
[inv_item_tbl]
--- item_code
--- item_desc
--- qnty

[serial_tbl]
--- serial_no
--- warranty_no

The output requirement for the report is:

------------------------------------------------
Item Code | Item Desc | Quanity
------------------------------------------------
itemcode1___itemdesc1___5
------------------------------------------------
S: serial1___W: warranty1
S: serial2___W: warranty2
S: serial3___W: warranty3
S: serial4___W: warranty4
S: serial5___W: warranty5
------------------------------------------------
itemcode2___itemdesc2___3
------------------------------------------------
S: serial6___W: warranty6
S: serial7___W: warranty7
S: serial8___W: warranty8
------------------------------------------------


I try to nest two datatables and my output becomes:

Item Code | Item Desc | Quanity | |
---------------------------------------------------------------------------------
itemcode1__itemdesc1____5______S: serial1___W: warranty1
______________________________S: serial2___W: warranty2
______________________________S: serial3___W: warranty3
______________________________S: serial4___W: warranty4
______________________________S: serial5___W: warranty5
---------------------------------------------------------------------------------
itemcode2__itemdesc2____3______S: serial6___W: warranty6
______________________________S: serial7___W: warranty7
______________________________S: serial8___W: warranty8
---------------------------------------------------------------------------------


Note: _ = whitespace

Please help me...

Thanks in advance.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Dynamic dataTable Using JSF
 
Similar Threads
JSF Datatable equivalent in Struts2
dataTable in JSF
can I let JSF datatable only display last one record ?
JSF dataTable issue
Create row index in dataTable