Using Repeaters in ViewStacks

Its very rarely I use Repeaters. I always thought of them as a way to get a list of items on the screen, yet they would always create all the items, therefore not being as optimized as a List that only creates just enough renderers, and re-uses them.

Recently on a job I required the children of a ViewStack to be driven by a dataProvider. The ViewStack required the same number of children as the number of items in the dataProvider. Each child should use its corresponding item in the dataprovdier to render its content, set via the data property.

I knew this could be handled with ActionScript, but ideally wanted a component that took care of it internally. To achieve this I built something called a DataStack, that had a dataProvider property. This worked fine but a couple of days later when building a custom container for tiling items I realized I’d been wasting my time, and a Repeater inside a ViewStack would have done the job I wanted.

What a donkey I am sometimes!

For good measure in the this example I added one of the new Efflex effects.

3 Responses to “Using Repeaters in ViewStacks”

  1. ThaStyle says:

    Dude really love ur way of thinkin.. wanna thank ya alot for all the good stuff..
    i was already using ur panelStack comp 2 do alot of simulated repeating. but this is much better, i wish i could help u out with the docs for efflex, i dont know if i have enough skills though.. but wanna trie, since there is no source avaible in the explorer , been exploring the utils and they are great , i am sure a lot of people could use those helpers. i think the main reason they invented asdocs in the first place is to make programmers understand each other better, simplest example is the isEven function there are like 39 ways to do the same little thingie :) and at least ten are the same in speed….
    anyways thanks m8 and let me know if i can help out
    Greetz Style

  2. flex hacker says:

    http://www.brainpop.co.uk/curriculum_matching_tool/index.weml

    yeh, spent a month wrestling with this. multiple repeaters with dynamic dataproviders and viewstacks. nearly drove me insane.

  3. [...] Clip

    DataStack

    A couple of weeks ago I made a post about using Repeaters in ViewStacks and I mentioned in the post I’d put together a class c [...]

Leave a Reply