• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Nested table without using datatable

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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:
 
Saloon Keeper
Posts: 27762
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Amy Mahapatra
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 27762
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
"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.

 
Bartender
Posts: 3648
16
Android Mac OS X Firefox Browser Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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)?
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic