Hi all,

I have a question concerning custom item renderers in lists, that use
states to change an items appearence depending on its selected status.

The scenario:

I have a list using a custom item renderer. If I select an item from
the list, I want to add another mx:Text component to that row's
renderer to show more detailed information. So I defined a state
inside the renderer component that adds another mx:Text as a child to
a VBox inside the renderer. Changing state is triggered listening to
the list's "change" event, which works perfectly

But here is my problem: If I add the child like this:

<mx:AddChild relativeTo="{vbox}">
   <mx:Text text="hello" />
</mx:AddChild>

everything works fine, the list row grows to the new height required
by its children. But if the text assigned to the new component gets to
long, I get a horizontal scrollbar for that component, which is
totally correct, but now what I want.

My solution was to set a width of 100% to the newly added text
component, which makes the text wrap: 

<mx:AddChild relativeTo="{vbox}">
   <mx:Text text="some really long text that need to be wrapped"     
            width="100%"/>
</mx:AddChild>

It does wrap now, but the height of the renderer component does not
adjust, it maintains its previous size and instead I get a vertical
scrollbar on the row.

Maybe I am doing something wrong, but I can not figure out how to
solve this.

Are there any hints or suggestions?

Reply via email to