Hi All,

I'm still trying to learn the intricacies of Flex and the auto sizing
of Text control's height (and the related word wrapping) is still one
area that really confuses me. 

For example, I have a text control:

<mx:Text id="nameText" width="250" text="{transaction.name}"/>

When the transaction object is set for the first time, and
transaction.name is longer than 250, only the first line is shown.
There is no wrapping. I would think that the explicit width 250 would
force word wrapping but this is not the case.

If I select another transaction in the UI, and then re-select the
original transaction, then the text control is correctly resized with
word wrapping. Why is this happening? What causes this strange behavior?

And the only way I can get word wrapping to work is to bind the text
control's width to it's parent's width:

<mx:Text id="nameText" width="{this.width-200}"
text="{transaction.name}"/>

This isn't really desirable though, because if the text is inside a
form item, then it is quite difficult to figure out what correct width
of the text should be (because the width is determined by the longest
label of all the form items, I believe).

Sometimes, though, I can get the text control to resize correctly by
calling validateNow(). But this doesn't always work. Why is that?

Anyways, any insights on these perplexing questions would be much
appreciated.

Thanks,
Peter

Reply via email to