filling some javaBean components with hierarchical container

Hi,

After having filled a hierarchical container from a javabean object, I now would like to do the opposite action : filling javabean object from a hierarchical container.

The first function is working

public static HierarchicalContainer getFormulaireContainer(Formulaire formulaire) {...}

but now I have to code the updateFormulaireFromContainer function with the following skeletton :

public static Formulaire updateFormulaireFromContainer(HierarchicalContainer hierarchicalContainer){...}

I think the second method is a bit hard because in the hierarchical container all the items are stocked in a flat structure way althought they have parents/childrens relationships.
So If I want to construct the JavaBean “Formulaire” I should iterate on all ID and find wether they have a parent or a child …

Formulaire is a JavaBean constructed like that :


Formulaire
       |
       ---List<Tab>
             |
             ---List<Zone>
                    |
                    ---List<Field>
                           |
                           ---String name
                           ---String type
                           ---int id

Is there a better method to to this ? Or should I code as suggested ?

Thanks,

Greetings !

Still facing this problem, I would be happy to know if I use the right way or not into using this kind of containers :slight_smile:

ps : Maybe an update in the documentation would be great for this particlar container used with data binding !