9 Replies Latest reply on Dec 28, 2009 11:18 AM by flairjax

    Tree Control

    flairjax

      So I have a custom control that is an extension of the Tree control and for some reason randomly the tree will not show its contents. The tree controls dataProvider is bound, dataProvider={somethingArrayCollection}, to a extended ArrayCollection.  When the debugging I see that the somethingArrayCollection is getting the data. It appears as those maybe the somethingArrayCollection is returning to slowly and/or the updateDisplayList and Measure calls are not getting called after the somethingArrayCollection is filled with data?

       

      I have tried doing the following sfter the somethingArrayCollection is filled with data, but this doesn't seem to help.

       

      typeTree.invalidateDisplayList();
      typeTree.invalidateProperties();
      typeTree.invalidateList();

       

      Wondering if any has had this issue before? Or have any areas to look at?

        • 1. Re: Tree Control
          John Hall Level 4

          Have you tried validating the dataProvider using validateNow()?

          • 2. Re: Tree Control
            flairjax Level 1

            John I am giving you 1000 bonus points and upping you two levels.

             

            J

            • 3. Re: Tree Control
              flairjax Level 1

              Ok, so that was short lived.  So now the tree is showing but the dropdown arrow doesn't work when you click it ( aka nothing happens ). Also, I am using an itemrenderer for leaf and branch nodes of the tree, which has a checkbox in it.  If you click the checkbox nothing happens, but if you click and then just move your mouse off the checkbox then the checkbox becomes selected.

               

              Again this is happening with only one UIComponent.  All other UIComponents are fine the tree works as expected clicking the arrow shows its children and clicking the checkbox checks the box.

               

              J

              • 4. Re: Tree Control
                John Hall Level 4

                OK, how about validating the tree control itself like myTree.validateNow();right after you update your arrayCollection or whatever is the dp.

                • 5. Re: Tree Control
                  flairjax Level 1

                  Yeah, I tried that also and got the same result. This is very strange how random it is.

                  • 6. Re: Tree Control
                    Flex harUI Adobe Employee

                    What does your extended collection do?  Can you run a tests with one of the collections we ship?

                     

                    Alex Harui

                    Flex SDK Developer

                    Adobe Systems Inc.

                    Blog: http://blogs.adobe.com/aharui

                    • 7. Re: Tree Control
                      flairjax Level 1

                      Found the issue. I have a popup that is an inline editor, similar to what you find in the new version of Word. On this inline editor is a button which causes another popup to show up, which contains my custom tree control.

                       

                      So you click a node, the inline editor shows up. Now in my code, if a node is a certain type I remove two buttons from the inline editor like so.

                       

                      if( ds == true )
                                          {
                                              masterEditorContextMenuPopUp.nodeMenuBar.setRootNodeButton.includeInLayout = false;
                                              masterEditorContextMenuPopUp.nodeMenuBar.setRootNodeButton.enabled = false;
                                              masterEditorContextMenuPopUp.nodeMenuBar.setRootNodeButton.visible = false;
                                             
                                              masterEditorContextMenuPopUp.nodeMenuBar.deleteNodeButton.includeInLayout = false;
                                              masterEditorContextMenuPopUp.nodeMenuBar.deleteNodeButton.enabled = false;
                                              masterEditorContextMenuPopUp.nodeMenuBar.deleteNodeButton.visible = false;

                       

                                          }

                       

                      This is where the issue lies.  I am not sure how this affects my second popup, but it does.  I debugged every step and the data gets passed back to my collection the same no matter what node is clicked or what is visible or not visible.  So to fix I did this.

                       

                      if( ds == _graphMediator.vis.data.root )
                                          {
                                              masterEditorContextMenuPopUp.nodeMenuBar.setRootNodeButton.includeInLayout = false;
                                              masterEditorContextMenuPopUp.nodeMenuBar.setRootNodeButton.enabled = false;
                                              masterEditorContextMenuPopUp.nodeMenuBar.setRootNodeButton.visible = false;
                                             
                                              masterEditorContextMenuPopUp.nodeMenuBar.deleteNodeButton.includeInLayout = false;
                                              masterEditorContextMenuPopUp.nodeMenuBar.deleteNodeButton.enabled = false;
                                              masterEditorContextMenuPopUp.nodeMenuBar.deleteNodeButton.visible = false;
                                             
                                             masterEditorContextMenuPopUp.nodeMenuBar.validateNow();
                                             
                                          }

                       

                      This validateNow on the inline Editor now fixes the next popup that shows to work.  I am at a loss for why one popup that when clicked just sends an event to cause a 2nd popup to show, would make the 2nd popup not render correctly.

                       

                      Thanks for everyones help.  If anyone is interested I can do a screen capture video of the before and after.

                       

                      Jason

                      • 8. Re: Tree Control
                        Flex harUI Adobe Employee

                        Is there an updateComplete handler on the MenuBar or its children that might affect things?

                         

                        Alex Harui

                        Flex SDK Developer

                        Adobe Systems Inc.

                        Blog: http://blogs.adobe.com/aharui

                        • 9. Re: Tree Control
                          flairjax Level 1

                          No I don't have an updateComplete handler.

                           

                          J