3 Replies Latest reply on Dec 23, 2009 11:27 AM by RossRitchey

    List inside a List inside a List problems

    RossRitchey Level 4

      I am working on a project where I am essentially creating a custom Tree component from embedded Spark List components.


      So, I have the root level, with a custom Skin and ItemRenderer.  The ItemRenderer includes a List that has includeIn="selected" set, so that it only displays when the root level item is selected.


      Then, if that level has children, I am using the same Skin and ItemRenderer for the next level.


      This is where problems come in.  For some reason, when I go to select an item in the second level, it almost immediately deselects itself.  Does anyone have any idea why this might be happening.  I have spent several hours trying to work through this, and can't seem to make any sense of it.


      This isn't the first time I've embedded Lists in this manner, but it is the first time i have required a selection to show the inner lists.


      Here is an image of the List as it currently stands.  The grey at the top is the root list selected item, and the indented list is embedded. Each of these has an embedded list on selection, but I can't seem to get the selection to stick.



      For further mystery (perhaps even a clue as to the issue?) When I select one, its list doesn't display the first time - a la:



      But then, the second time I click it:




      Which is moot, because the item won't hold its selection.


      Any ideas?

        • 1. Re: List inside a List inside a List problems
          RossRitchey Level 4

          Oh yeah, I neglected to mention the details of my install.


          I am on Win XP SP3, running Flash Builder 4 Beta2, and build 13099 of the Flex 4 SDK.  The project is publishing to AIR (most current non-beta version)

          • 2. Re: List inside a List inside a List problems
            Flex harUI Adobe Employee

            I'd be concerned that when you click on the inner List, that even the outer List will see that click.  It might also be that if you alter the dataProvider enough to get the List to display that you get a mouseOut as we change renderers or that selectedIndex gets reset as we change renders.


            Is there a reason you can't use mx:Tree with s:MXTreeItemRenderer?  Or even the way I modified Spark List to show hierarchical data that is on my blog?


            Alex Harui

            Flex SDK Developer

            Adobe Systems Inc.

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

            1 person found this helpful
            • 3. Re: List inside a List inside a List problems
              RossRitchey Level 4

              Yes, I had recently determined that the cause was the selectionChange firing on the outer list.


              To answer your question, there really isn't a good reason I can't.  When I started learning the Spark architecture, I challenged myself to forego the halo components altogether, and have been building with that in mind.


              Its really funny, I was looking at that post on your blog yesterday, and I downloaded the source, and couldn't understand how the thing was built.


              So, it looks like I need to do 1 of 2 things.


              1. Figure out a way to change the hit area for the List component, or otherwise swallow the selectedIndexChange on the parent List.




              2. Re-build using the mx:Tree or figure out how yours works.