views:

103

answers:

2

I am having problems with text with multiple lines not reformatting properly when I call loadStyleDeclarations. However if I load the same stylesheet TWICE then it correctly refreshes and reformats the text.

So what I want to do is refresh my control to get it to reformat the text. I've tried ValidateNow() and ValidateDisplayList() but neither seems to cause the correct kind of layout request.

I'm guessing loadStyleDeclarations() calls some other revalidation function, but i jsut cant find what it is.

+1  A: 

Try calling invalidateProperties() and/or invalidateDisplayList() on your component. That should cause the component to be rerendered on a next screen update.

Christophe Herreman
Turns out you have to call invalidateDisplayList() on the Text control itself. I assumed it was recursive at first, but then I thought I'd try it on the Text control itself which worked. Not even calling invalidateDisplayList() on the immediate container works. Thx
Simon_Weaver
A: 

Did you call setStyle on the things that aren't updating?

William Power
no. the style itself updates just fine, but the dimensions of it werent being recalculated. it was just a simple mx:Text control with a styleName set, width=100%.
Simon_Weaver