Note that there are some explanatory texts on larger screens.

plurals
  1. POMXML: combobox width is larger than parent width
    primarykey
    data
    text
    <p>I have a combobox with a width set to 100%. However, when one of its elements is larger, the combobox grows larger aswell, creating scrollbars and other uglyness in my app! How do I keep the combobox contained within its parent?<br> NB it's OK if the list that drops down is larger as long as the closed combobox stays smaller.</p> <p>Sample:</p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;mx:Canvas xmlns:mx="http://www.adobe.com/2006/mxml" width="100%" height="100%"&gt; &lt;!-- I'm using a Canvas instead of a VBox because the VBox spaces the elements too far appart --&gt; &lt;mx:HBox id="tagsHBox" width="{formsHBox.width - 16}" x="8" y="8"&gt; &lt;!-- This label should align with the labels in the left form --&gt; &lt;mx:Label text="Tags" id="tabLabel" width="{titleTxt.x + 4}" textAlign="right" /&gt; &lt;!-- This textbox should spread accross both forms, that's why it's in a seperate HBox --&gt; &lt;mx:TextInput height="20" width="100%" /&gt; &lt;/mx:HBox&gt; &lt;mx:HBox id="formsHBox" x="8" y="{8 + tagsHBox.height}" width="{this.width-16}"&gt; &lt;mx:Form id="leftForm" width="50%"&gt; &lt;!-- Personal details --&gt; &lt;mx:FormHeading label="Personal Details" width="100%" /&gt; &lt;mx:FormItem label="First name" width="100%"&gt; &lt;mx:TextInput text="{person.firstName}" width="100%"/&gt; &lt;/mx:FormItem&gt; &lt;mx:FormItem label="Last name" width="100%"&gt; &lt;mx:TextInput text="{person.lastName}" width="100%"/&gt; &lt;/mx:FormItem&gt; &lt;!-- And 15 more formItems :) --&gt; &lt;/mx:Form&gt; &lt;mx:Form id="rightForm" width="50%"&gt; &lt;!-- Address --&gt; &lt;mx:FormHeading label="Address" width="100%" /&gt; &lt;mx:FormItem label="Street" width="100%"&gt; &lt;mx:TextInput text="{person.address.street}" width="100%"/&gt; &lt;/mx:FormItem&gt; &lt;mx:FormItem label="City" width="100%"&gt; &lt;mx:TextInput text="{person.address.city}" width="100%"/&gt; &lt;/mx:FormItem&gt; &lt;mx:FormItem label="Country" width="100%"&gt; &lt;!-- This combobox right here is the troublemaker. There's a country named 'South Georgia and the South Sandwich Islands' consising of a few small islands in the southern pacific and a name which is too long for my innocent unsuspecting combobox --&gt; &lt;form:ComboBox id="countryCombo" height="20" width="100%" dataProvider="{model.systemDataModel.countries}" /&gt; &lt;/mx:FormItem&gt; &lt;!-- And 15 more formItems :) --&gt; &lt;/mx:Form&gt; &lt;/mx:HBox&gt; &lt;/mx:Canvas&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload