Parent and Children display in a SplitPanel

Hi

First time poster. I Just stumbled on this framework and thanks for the great work. It is so beautiful to work with . Am trying to to create a page which has a SplitPanel as shown below

                PARENT LIST     

               CHILDREN LIST      

I have a PARENT and CHILD relation object graph with with ONE to MANY. Am getting a list of parent objects from the DB lazily loading the children. Am able to load the list of parents.

I want when a user clicks on the parent Item in the PARENT LIST section, the child list or Items of the Parents gets loaded in the children list section. When a user first open the page I want to just load the Parent list and leave the children list blank.

I have gotten confused about how to manage these events and display the child list. What is the best way to do it? I have modelled my solution around the address book tutorial layout, but I just can’t get the list to display for children when I click on the parent. Any help will be appreciated.

Kabs

You could use one Table for the parent and one Table for the children. The your UI would look something like this:

YourApplication
|
Window
|
SplitPanel
| |
Table Table

Then say parentTable.setSelectable(true) and addListener(Property.ValueChangeListener) to the parent. Each time you click a row on parent table, your listener can reset the contects of the child-table.

The most easy way to do it, if you do not have a lots of data, is to just add all the data directly to the table with addItem(). If you have more data, you surely want to use data sources. Some of the available options would be HbnContainer, QueryContainer, (statically shared) IndexedContainer or a container implementation of your own.

Thanks for the reply. I managed to figure it out. Created separate tables for both lists and it is now working fast and beautifully. I also generated two separate data sources using a IndexedContainer.