7 Replies Latest reply on Sep 10, 2008 1:33 PM by Brent Lamborn

    Nested repeaters in Flex 3

    Brent Lamborn Level 2
      I have an Flex app that uses nested repeaters. The inner repeater uses the outer repeater's currentItem property.

      When using nested repeaters, do they repeat in an asynch fashion? It seems as though the outer repeater is repeating before the inner repeater gets done repeating over the outer's current item, causing data to be displayed incorrectly.

      Can anyone give an example of how to use nested repeaters from a single xml dataProvider? IE. The inner repeater should use the outer repeater's currentItem property, and the data should appear correctly in the UI.
        • 1. Re: Nested repeaters in Flex 3
          Level 7

          "BrentLamborn" <webforumsuser@macromedia.com> wrote in message
          news:ga3jbs$6n7$1@forums.macromedia.com...
          >I have an Flex app that uses nested repeaters. The inner repeater uses the
          > outer repeater's currentItem property.
          >
          > When using nested repeaters, do they repeat in an asynch fashion? It seems
          > as
          > though the outer repeater is repeating before the inner repeater gets done
          > repeating over the outer's current item, causing data to be displayed
          > incorrectly.

          What is displaying incorrectly? Can you post some code?


          • 2. Re: Nested repeaters in Flex 3
            Brent Lamborn Level 2
            Attached is my MXML. Data is being shown in the incorrect category. The XML is correct, but it appears the outer repeater is repeating before the inner repeater(s) finish with the currentItem.
            • 3. Re: Nested repeaters in Flex 3
              Brent Lamborn Level 2
              The spacers are there per the Fl;ex 2 documentation on nested repeaters here http://livedocs.adobe.com/flex/201/html/wwhelp/wwhimpl/common/html/wwhelp.htm?context=Live Docs_Book_Parts&file=repeater_078_15.html though they aren't doing any good. I am using a Flex 3, but thought it was a worth a shot.
              • 4. Re: Nested repeaters in Flex 3
                Level 7

                "BrentLamborn" <webforumsuser@macromedia.com> wrote in message
                news:ga3mec$acn$1@forums.macromedia.com...
                > Attached is my MXML. Data is being shown in the incorrect category. The
                > XML is
                > correct, but it appears the outer repeater is repeating before the inner
                > repeater(s) finish with the currentItem.

                What is happening that leads you to that conclusion?


                • 5. Re: Nested repeaters in Flex 3
                  Brent Lamborn Level 2
                  Well, as I have said all along, my data is being displayed in the wrong category. In this case, a category is a seperate tab in a TabNavigator. As I have stated previously, the data in my XML dataProvider is correct. However it is being displayed incorrectly by the repeaters.

                  So basically the answer to your question "What is happening that leads you to that conclusion? " is this:

                  I open my eyeballs and looked at the screen and saw that data is being displayed in the wrong tab.
                  • 6. Re: Nested repeaters in Flex 3
                    ntsiii Level 3
                    When working with Repeater, especially with complex UI and especially especailly with nested repeaters, create a custom component, and repeat that. Pass in the entire currentItem. There will be no iteraction whatsoever between the nested repeater and the outer repeater.

                    By the way, bad attitude rarely helps your cause.

                    Tracy
                    • 7. Nested repeaters in Flex 3
                      Brent Lamborn Level 2
                      ntsii

                      True a bad attitude doesn't help but I don't think I had a bad attitude. Its pretty frustrating though when people ask questions that can be answered if the post is read carefully. What happens is everyone else thinks the question is being taken care of when its not.

                      I see what you mean with the CustomCompnent. I did create a custom component and repeat over it, but didn't pass in the entire currentItem, just properties of it.

                      What I ended up doing though, was removing the inner-most repeater out of the 3, and I replaced it with a list instead, and that worked out really well in my case. It also loaded that 'page' much quicker too.