This content has been marked as final.
Show 3 replies
-
1. Re: Examples for nested data
yacho Sep 30, 2007 11:09 AM (in response to robshep)Well there are two aspects of the problem:
1. Getting Your actual data organized in an intendend way - this happens in EJB's so you should reserch on Entity relations in EJB3.
Once you got that you Can fetch your entity with all referenced data - and display it somehow - i'd suggest RichFacs tree for that - see richfaces site for details. -
2. Re: Examples for nested data
robshep Sep 30, 2007 5:23 PM (in response to robshep)I understand the basic concepts. Data organisation for this project is trivial.
Houses->Rooms->Chairs"Yacho" wrote:
You Can fetch your entity with all referenced data - and display it somehow
No I can't.... hence OP :)
The actual display tree component is irrelavent at this stage. Take for example my model....
House class has a@OneToMany List<Room> rooms
in it.
Room has aHouse house
parent reference in it.
hibernate deploys this and generates the tables, with constraints, as i would expect. My first step would be to, for example, show the list of houses with the number of rooms in each. I've seen the boilerplate generated code for displaying normal properties, E.g. #{house.name} but how do i go about displaying house.rooms.size() in JSF/facelet. does any code for this need to go in a session bean? what alterations go in the entity.
as i said i'm a beginner. a simple as possible please.
many thanks
Ro -
3. Re: Examples for nested data
pmuir Oct 4, 2007 6:00 PM (in response to robshep)Assuming you have some factory for house to expose the current house in EL
#{house.rooms.size}
should work fine