1 Reply Latest reply on Jun 7, 2010 2:25 AM by Bart Wouters

    Tree component customization

    Bart Wouters

      Hi all,


      I'm new to flex and having a hard time figuring out the best way to approach the following problem (in Flex context, _not_ AIR):


      I need a tree representation of some hierarchical/composite data structures as depicted below (for those familiar with XMLSpy, the diagram is similar to the XSD tree structure diagrams):


                                                                                           | Child       |

                                                                                           | child info  |

                                            |------------------|                           |-------------|

                                         |--| Child            |--------- Choice (x) ------|

                                         |  | Child Info      (x)                          |-------------|

                                         |  --------------------                           | Child       |

                                         |                                                 | child info  |

      ---------------                    |  |------------------|                           |-------------|

      | Parent      |------ Sequence (x)-|--| Child            |

      | Parent Info (x)                  |   | Child Info     (x)

      ---------------                    |   --------------------


                                         |  |------------------|

                                         |--| Child            |

                                            | Child Info      (x)




      The (x) in the picture are the collapse/expand buttons.


      What would be the best way to approach this project ?

      - Is it a customization of the standard Tree component + custom Tree Item Renderer ?

      - The nodes should be expandable/collapsible + selectable (additional information to be displayed on selection of node without expand/collapse effect)


      - For the nodes would it make sense to derive them from the ToggleButton ? (and what would be the most sensefull way of introducing the second line on the button ? Or just building a proper graphical component for it (derived from Group)?

      - What is the most effective way to deal with the balancing of the tree in such a way that subtrees move out of the way/in place on expand resp. collapse of nodes ? (through (H/V)groups ?)

      - What would be the most efficient way to deal with the connectors between nodes ?

      - dataprovider would be an XML structure - what is the best place to put the building algo ? (Every node know how to create itself and the first level children ? Or a tree traverse on the XML structure, building all components in one go ?)


      Any advice/thoughts/references are welcome !


      Thanks in advance,

      Best regards,