# MXML help pls: possible to have conditional repeaters

**URL:** <https://forum.kirupa.com/t/mxml-help-pls-possible-to-have-conditional-repeaters/307615>\
**Category:** flash\
**Created:** [April 7, 2010, 12:20am UTC](https://forum.kirupa.com/t/mxml-help-pls-possible-to-have-conditional-repeaters/307615 "2010-04-07T00:20:39Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![iakiak](https://avatars.discourse-cdn.com/v4/letter/i/ed8c4c/32.png) [@iakiak](https://forum.kirupa.com/u/iakiak)\
**Post date:** [April 7, 2010, 12:20am UTC](https://forum.kirupa.com/t/mxml-help-pls-possible-to-have-conditional-repeaters/307615/1 "2010-04-07T00:20:39Z")

</div>

Hihi,  
I have an inventory window which has several tabs.  
When a tab is selected it a repeater populates the window with a list of items:

```auto

[SIZE=2][SIZE=2]<mx:Repeater [/SIZE][/SIZE][SIZE=2]id="[/SIZE][SIZE=2][SIZE=2]iconRepeater[/SIZE][/SIZE][SIZE=2]" count="[/SIZE][SIZE=2][SIZE=2]{[/SIZE][/SIZE][SIZE=2]maxIconsPerPage[/SIZE][SIZE=2][SIZE=2]}[/SIZE][/SIZE][SIZE=2]" startingIndex="[/SIZE][SIZE=2][SIZE=2]{[/SIZE][/SIZE][SIZE=2]pageNumber*maxIconsPerPage[/SIZE][SIZE=2][SIZE=2]}[/SIZE][/SIZE][SIZE=2]" recycleChildren="[/SIZE][SIZE=2][SIZE=2]true[/SIZE][/SIZE][SIZE=2]"[/SIZE][SIZE=2][SIZE=2]>[/SIZE][/SIZE]
[SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]<mx:Canvas>[/COLOR][/SIZE][/COLOR][/SIZE]
[LEFT][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]<UIComponents:Icon[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] itemID="[/SIZE][SIZE=2][COLOR=#990000][SIZE=2][COLOR=#990000]{[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2]iconRepeater.currentItem.itemID[/SIZE][SIZE=2][COLOR=#990000][SIZE=2][COLOR=#990000]}[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2]"/> [/SIZE][/LEFT]
[SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]</mx:Canvas>[/COLOR][/SIZE][/COLOR][/SIZE] 
[SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]</mx:Repeater>[/COLOR][/SIZE][/COLOR][/SIZE]

```

[LEFT]Now some of the tabs use larger icons so I would like the repeater to populate depending on a variable.  
Is something like this possible:[/LEFT]

```auto

[SIZE=2][SIZE=2]<mx:Repeater [/SIZE][/SIZE][SIZE=2]id="[/SIZE][SIZE=2][SIZE=2]iconRepeater[/SIZE][/SIZE][SIZE=2]" count="[/SIZE][SIZE=2][SIZE=2]{[/SIZE][/SIZE][SIZE=2]maxIconsPerPage[/SIZE][SIZE=2][SIZE=2]}[/SIZE][/SIZE][SIZE=2]" startingIndex="[/SIZE][SIZE=2][SIZE=2]{[/SIZE][/SIZE][SIZE=2]pageNumber*maxIconsPerPage[/SIZE][SIZE=2][SIZE=2]}[/SIZE][/SIZE][SIZE=2]" recycleChildren="[/SIZE][SIZE=2][SIZE=2]true[/SIZE][/SIZE][SIZE=2]"[/SIZE][SIZE=2][SIZE=2]>[/SIZE][/SIZE]
[SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]<mx:Canvas>[/COLOR][/SIZE][/COLOR][/SIZE]
    *if large*
 [SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff] <UIComponents:IconLarge[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] itemID="[/SIZE][SIZE=2][COLOR=#990000][SIZE=2][COLOR=#990000]{[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2]iconRepeater.currentItem.itemID[/SIZE][SIZE=2][COLOR=#990000][SIZE=2][COLOR=#990000]}[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2]"/> [/SIZE]
[LEFT] *else*
    [COLOR=#0000ff]<UIComponents:IconSmall[/COLOR][SIZE=2] itemID="[/SIZE][SIZE=2][COLOR=#990000][SIZE=2][COLOR=#990000]{[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2]iconRepeater.currentItem.itemID[/SIZE][SIZE=2][COLOR=#990000][SIZE=2][COLOR=#990000]}[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2]"/> [/SIZE]
[SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]</mx:Canvas>[/COLOR][/SIZE][/COLOR][/SIZE] [/LEFT]
[SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]</mx:Repeater>[/COLOR][/SIZE][/COLOR][/SIZE]

```

If this isn’t possible what do you think is the best way to achieve what I am trying to do.

I tried using states but it would add extra children to the start of the list.

I’ve also tried doing this:  
At the moment we have  
Window -\> tab -\> icon  
Add a largetab class that extends tab but while I was able have different layout variables for the tab class I wasnt able to override the iconRepeater.

Thanks for any suggestions that may come!
