Components inside a repeater not resizing as expected

Posted by VoidPointer on Stack Overflow See other posts from Stack Overflow or by VoidPointer
Published on 2010-06-03T16:20:35Z Indexed on 2010/06/03 16:24 UTC
Read the original article Hit count: 227

Filed under:
|
|

I have an mxml panel in which I'm using a repeater. The panel can be resized horizontally and I would like for the repeated components to resize together with panel. Here is a simplified example of how things look like:

<mx:TitleWindow xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical" ...>
    <!-- scripts and some controls -->
    <mx:VBox width="100%">
        <core:Repeater width="100%" dataProvider="model">
            <ns1:MyItemRenderer width="100%" />
        </core:Repeater>
    </mx:VBox>
</mx:TitleWindow>

When I resize the component, the width of the repeated items does not change.

There also buttons and event handlers, which add and remove items from the model. When this is done, the repeater updates to display the correct number of items and all the items are resized correctly.

I have not been able to get the items to resize when the root panel is resized. I can see, that the VBOx around the repeater is getting a resize event. However, the repeated items are not getting the event. I tried to dispatch a resize event to the repeated items manually from a resize handler I hooked up to the VBox but that didn't help.

I also tried adding and removing a dummy-item from the ArrayCollection which is the dataProvider (because that triggers a correct resize otherwise as mentioned above) However, doing this in the resize handler of the VBox just leads to the repeater not showing any items at all.

Is there any way to get items in a repeater to resize with their enclosing container?

© Stack Overflow or respective owner

Related posts about flex

Related posts about repeater