5 Replies Latest reply on Oct 9, 2008 7:40 AM by Newsgroup_User

    Scrolling on List with States causing state change

      Hi,
      I need a list where each row can be expanded/collapsed to show/hide extra data. I need to use something like a list control for performance (i.e. can't use repeaters) and I have implemented a solution provided here:
      http://weblogs.macromedia.com/pent/archives/2006/04/a_list_itemrend.html
      However on this solution when expand the first 3 rows and then start scrolling, the states change. The same happens on my own custom solution. I have tried put a currentStateChanging event in place to pick up the target of the event but can't find it. I don't know why this is happening but am beginning to think its a Flex issue that may not have a resolution?

      Any ideas or explanations appreciated - or suggestions of how to implement my list????
      Thanks,
      Orla
        • 1. Re: Scrolling on List with States causing state change
          Level 7

          "spatz04" <webforumsuser@macromedia.com> wrote in message
          news:gcg17p$qis$1@forums.macromedia.com...
          > Hi,
          > I need a list where each row can be expanded/collapsed to show/hide extra
          > data. I need to use something like a list control for performance (i.e.
          > can't
          > use repeaters) and I have implemented a solution provided here:
          > http://weblogs.macromedia.com/pent/archives/2006/04/a_list_itemrend.html
          > However on this solution when expand the first 3 rows and then start
          > scrolling, the states change. The same happens on my own custom solution.
          > I
          > have tried put a currentStateChanging event in place to pick up the target
          > of
          > the event but can't find it. I don't know why this is happening but am
          > beginning to think its a Flex issue that may not have a resolution?
          >
          > Any ideas or explanations appreciated - or suggestions of how to implement
          > my
          > list????

          You may find some help for this in Q2:
          http://www.magnoliamultimedia.com/flex_examples/Amys_Flex_FAQ.pdf

          Or here
          http://blog.flexmonkeypatches.com/2007/09/10/flex-tilelist-with-togglebuttons/

          HTH;

          Amy



          1 person found this helpful
          • 2. Re: Scrolling on List with States causing state change
            Hi,
            The first link in the respose above has helped me to understand what my problem is (i.e. itemRenderers being recycled) and the second link may lead me to a solution but I'm having trouble understanding exactly when the 'set data' function that I am overriding in my List itemRenderer gets invoked.
            If I pass an ArrayCollection to the List dataprovider with say 5 items, and set a breakpoint in my 'set data' function, I was expecting this to be called only 5 times. However through debugging I can see it being called numerous times for each item in the arrayCollection?
            Anyone understand this?
            • 3. Re: Scrolling on List with States causing state change
              Level 7

              "spatz04" <webforumsuser@macromedia.com> wrote in message
              news:gcijos$al5$1@forums.macromedia.com...
              > Hi,
              > The first link in the respose above has helped me to understand what my
              > problem is (i.e. itemRenderers being recycled) and the second link may
              > lead me
              > to a solution but I'm having trouble understanding exactly when the 'set
              > data'
              > function that I am overriding in my List itemRenderer gets invoked.
              > If I pass an ArrayCollection to the List dataprovider with say 5 items,
              > and
              > set a breakpoint in my 'set data' function, I was expecting this to be
              > called
              > only 5 times. However through debugging I can see it being called numerous
              > times for each item in the arrayCollection?
              > Anyone understand this?

              http://flexdiary.blogspot.com/2008/04/is-horizontallist-faster-than-hbox-with.html

              This gives one reason for what you're seeing, but I think the fact that you
              have variableRowHeights means it runs through it once to measure it and once
              to draw it, so it knows how many it has room to put on the screen. I'd
              encourage you to also look at the section (you'll probably have to scroll
              down to see it) called Labels in the right column and click on the
              itemRenderer label. I went through a lot of research in figuring all this
              out, and a good deal of that is documented on my blog.

              HTH;

              Amy


              1 person found this helpful
              • 4. Re: Scrolling on List with States causing state change
                Thanks for your help Amy.
                I figured out a solution to my initial problem, I am setting a flag in the data object to determine the state of each row and that works. However the scrolling is so messy its not usable. The scrolling jumps all over the place. I'm guessing this is a trade off of using the List instead of a repeater and doubt there is a way to resolve this.

                If anyone know or has come accross a solution to this scrolling issue could you lt me know?
                Thanks
                • 5. Re: Scrolling on List with States causing state change
                  Level 7

                  "spatz04" <webforumsuser@macromedia.com> wrote in message
                  news:gcl3ah$jdf$1@forums.macromedia.com...
                  > Thanks for your help Amy.
                  > I figured out a solution to my initial problem, I am setting a flag in the
                  > data object to determine the state of each row and that works. However the
                  > scrolling is so messy its not usable. The scrolling jumps all over the
                  > place.
                  > I'm guessing this is a trade off of using the List instead of a repeater
                  > and
                  > doubt there is a way to resolve this.
                  >
                  > If anyone know or has come accross a solution to this scrolling issue
                  > could
                  > you lt me know?

                  I think Peter Ent said somewhere on his blog that it's not worth the time to
                  try to get this working with variableRowHeight and lists.