5 Replies Latest reply on Oct 29, 2008 2:42 AM by pbittner

    Repeater performance

    pbittner
      I'm currently working on a Flex project and need to show the content of a dictionary (a xml file). After the creation of an Entry object for each entry of my dictionary, the easiest way to display one entry is to use one Repeater for the entry's attributes (each entry has got one or more attributes), one Repeater for the attribute's items (each attribute has got items) and one Repeater for the item's links (each item has got links). But as you can guess it's not very efficient. I cannot harcode because my App must be able to display any kind of dictionary which means different numbers of attributes, items and links. Any idea ?


        • 1. Re: Repeater performance
          Level 7

          "pbittner" <webforumsuser@macromedia.com> wrote in message
          news:ge77no$cso$1@forums.macromedia.com...
          > I'm currently working on a Flex project and need to show the content of a
          > dictionary (a xml file). After the creation of an Entry object for each
          > entry
          > of my dictionary, the easiest way to display one entry is to use one
          > Repeater
          > for the entry's attributes (each entry has got one or more attributes),
          > one
          > Repeater for the attribute's items (each attribute has got items) and one
          > Repeater for the item's links (each item has got links). But as you can
          > guess
          > it's not very efficient. I cannot harcode because my App must be able to
          > display any kind of dictionary which means different numbers of
          > attributes,
          > items and links. Any idea ?

          If you can pare it down to use Canvases or even UIComponents instead of
          HBoxes and VBoxes, that will help performance a lot. Also, you might want
          to look at setting the recycleChildren property to true.

          HTH;

          Amy


          • 2. Repeater performance
            pbittner Level 1
            I have tried to remove completely the Hbox and Vbox I'm using but it's not quicker. The problem comes from the 3 Repeaters.

            Concerning the recycleChildren property, I've tried but the result is completely wrong. I think that I cannot use it as each object repeated in the repeater is different (it can have different children itself and not always the same number of children).

            I have also tried to replace the first Repeater by Hardcode (I know how many attributes I need to display for each entry of the dictionary I'm using now), it's quicker but doesn't solve my problem because the number of attributes changes if I want to display another dictionary. However I can know how many attributes to display when the App loads (it's a parameter in my xml file). Is there any way to produce some kind of harcode at that time and use it each time I need to display an entry to avoid using the first Repeater.
            • 3. Re: Repeater performance
              Level 7

              "pbittner" <webforumsuser@macromedia.com> wrote in message
              news:ge7dfc$kq5$1@forums.macromedia.com...
              > How can I use Canvases instead of Vbox and Hbox when I don't know how many
              > children my Canvas gonna have ?

              Use an expression in the x and y field of the component that's being
              repeated to lay it out properly.

              > And concerning the recycleChildren property, I've tried but the result is
              > completely wrong. I think that I cannot use it as each object repeated in
              > the
              > repeater is different (it can have different children itself and not
              > always the
              > same number of children).

              You need to use invalidation to make sure that each object can refresh
              itself when it's reused, similar to what you have to do when you make an
              itemRenderer for a List based component.

              HTH;

              Amy


              • 4. Re: Repeater performance
                Cesare Rocchi Level 2
                quote:

                Originally posted by: pbittner
                I have tried to remove completely the Hbox and Vbox I'm using but it's not quicker. The problem comes from the 3 Repeaters.

                Concerning the recycleChildren property, I've tried but the result is completely wrong. I think that I cannot use it as each object repeated in the repeater is different (it can have different children itself and not always the same number of children).



                Looks a complex scenario. You might want to consider Actionscript, which enables much more control over instantiation, deletion and recycle.
                • 5. Re: Repeater performance
                  pbittner Level 1
                  I'm using Cairngorm and wanted to avoid using too much Actionscript for my views but this time it's much quicker that way. Thanks!