File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JSF and the fly likes Nested table without using datatable Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSF
Bookmark "Nested table without using datatable" Watch "Nested table without using datatable" New topic
Author

Nested table without using datatable

Amy Mahapatra
Greenhorn

Joined: Apr 10, 2014
Posts: 2
Need to create a nested table without using datatable. Please help me to achieve this asap. I am using jsp and jsf but using datatable is not allowed. :banghead:
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16011
    
  19

Welcome to the JavaRanch, Amy!

JSP is not part of JSF since JSF version 2.

WHY are you not allowed to use dataTable? If this is some idiot manager's idea, its' THEY who need some head-banging!

Nested datatables are painful, though. Even in the latest versions of JSF, getting the current row of the inner table requires some awkward code.


Customer surveys are for companies who didn't pay proper attention to begin with.
Amy Mahapatra
Greenhorn

Joined: Apr 10, 2014
Posts: 2
There is some requirements for not using datatable.. If anyone can tell me how to pass values from backing bean for each column.. I guess i need little example. I am somewhat successful in building a raw table and one nested table. But unable to pass values :(
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16011
    
  19

"some requirements" is often a euphemism for "manager is an idiot". My recommendation on how to solve such problems involves updating one's CV if said manager(s) cannot be persuaded to discard such arbitrary limitations. Deliberately avoiding industry standard solutions because some "expert" arbitrarily forbade them just means that whatever workaround is done is typically going to be time-consuming, expensive, often fragile, and more difficult/expensive to maintain.

JSF expects to do all the fetching and updating between Model and View itself. JSF is a fairly pure implementation of the MVC paradigm, but in JSF, you don't write Controllers to do the transfer of data between Model and View, they are pre-written parts of the JSF FacesServlet and tag implementations. And the h:dataTable tag implementation in particular for such cases as the one you describe.

Unfortunately, the current implementation of dataTable doesn't take nesting into account, so some helper code has to be written that makes up for that lack.

K. Tsang
Bartender

Joined: Sep 13, 2007
Posts: 2346
    
    7

I agree with Tim here about the manager's thinking. It would be a cake using datatable with sub-datatable or row expansion.

If indeed datatable is not allowed, does that mean doing a table in html/jstl (the old fashioned way)?


K. Tsang JavaRanch SCJP5 SCJD/OCM-JD OCPJP7 OCPWCD5
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Nested table without using datatable