3 Replies Latest reply on Oct 7, 2008 6:43 AM by Newsgroup_User

    Strange Flex 3 Tree behaviour. A bug?

    newflexquest
      Hello Everyone!

      I use the flex 3 Tree component with a custom data descriptor.
      The data-structure, which is processed by the data descriptor,
      allows that one node may have several parent-nodes.
      In this case the node is being shown in tree several times - once for every
      parent-node.
      The node itself may also have several children. (Some sort of a simplified Graph structure.)

      This is rendered well, but when I open the node in the tree, the same node is automatically
      opened by other parent-nodes. When i move the mouse-pointer over the nodes-children. they are not highlighted, and the respective children of some other parent-node are.

      Any Ideas?

      Thanks!
        • 1. Re: Strange Flex 3 Tree behaviour. A bug?
          Level 7

          "newflexquest" <webforumsuser@macromedia.com> wrote in message
          news:gccrhc$k9u$1@forums.macromedia.com...
          > Hello Everyone!
          >
          > I use the flex 3 Tree component with a custom data descriptor.
          > The data-structure, which is processed by the data descriptor,
          > allows that one node may have several parent-nodes.
          > In this case the node is being shown in tree several times - once for
          > every
          > parent-node.
          > The node itself may also have several children. (Some sort of a simplified
          > Graph structure.)
          >
          > This is rendered well, but when I open the node in the tree, the same node
          > is
          > automatically
          > opened by other parent-nodes. When i move the mouse-pointer over the
          > nodes-children. they are not highlighted, and the respective children of
          > some
          > other parent-node are.

          http://flexdiary.blogspot.com/2008/07/musings-on-advanceddatagrid-part-5_03.html


          • 2. Re: Strange Flex 3 Tree behaviour. A bug?
            newflexquest Level 1
            Thats right, this behaviour takes plase only while using the same object instance several times in the tree.
            The bad stuff is that i need exactly this :)
            I cannot destroy data-integrity by duclicating nodes and all of their children, and their children and so on...

            I made a debug in Tree, List and ListBase classes. The behaviour is as follows:
            1. DisplayObjects are created for each appearance of the data-object in the tree.
            2. On mouse-over event the display-object is taken to find corresponding data-object. Data-objects are stored in a map as key-value pairs, where the key is object-id and the value is the object itself (plus the coordinates on the screen).

            Therefore it is clear: if an item must appear twice in the tree, related data-object may not be placed twice to the map (key violation). So at the end we have at the background only ONE data-object for all of the display-objects which represent duplication of the same item. And this one object contains only one set of coordinates (of one related display object).
            It is not important on which of the duplicated display objects you fire the mouse-over event. You will see the highlicht only on the display-object, whichs coordinates are stored in the map.

            I hope the explanation is not heavy to read.
            • 3. Re: Strange Flex 3 Tree behaviour. A bug?
              Level 7

              "newflexquest" <webforumsuser@macromedia.com> wrote in message
              news:gcfaoi$5i$1@forums.macromedia.com...
              > Thats right, this behaviour takes plase only while using the same object
              > instance several times in the tree.
              > The bad stuff is that i need exactly this :)
              > I cannot destroy data-integrity by duclicating nodes and all of their
              > children, and their children and so on...
              >
              > I made a debug in Tree, List and ListBase classes. The behaviour is as
              > follows:
              > 1. DisplayObjects are created for each appearance of the data-object in
              > the
              > tree.
              > 2. On mouse-over event the display-object is taken to find corresponding
              > data-object. Data-objects are stored in a map as key-value pairs, where
              > the key
              > is object-id and the value is the object itself (plus the coordinates on
              > the
              > screen).
              >
              > Therefore it is clear: if an item must appear twice in the tree, related
              > data-object may not be placed twice to the map (key violation). So at the
              > end
              > we have at the background only ONE data-object for all of the
              > display-objects
              > which represent duplication of the same item. And this one object contains
              > only
              > one set of coordinates (of one related display object).
              > It is not important on which of the duplicated display objects you fire
              > the
              > mouse-over event. You will see the highlicht only on the display-object,
              > whichs
              > coordinates are stored in the map.
              >
              > I hope the explanation is not heavy to read.

              Write your own tree...?