Recently I discovered that setting a combobox to width="100%" doesn't mean the combobox won't grow bigger than the width of its container. If the text cannot be completely displayed your combobox becomes wider than 100%. You can use the following construction to tame its width:
<mx:canvas id="cnvs" width="100%" resize="cb.width = cnvs.width">
<mx:combobox id="cb" text="this is a rather long combobox text" />
</mx:canvas>
Simply add a canvas around the combobox and explicitly set the width of the combobox to the width of the canvas through the resize event of the canvas. This solution works because the problematic behaviour only occurs when using a percentage width.
The same applies to the Label component (and probably some other components as well).
Showing posts with label combobox. Show all posts
Showing posts with label combobox. Show all posts
Tuesday, January 22, 2008
Subscribe to:
Posts (Atom)
