Details
-
Bug
-
Status: Resolved
-
Trivial
-
Resolution: Fixed
-
Adobe Flex SDK 4.0 (Release)
-
None
-
Affected OS(s): All OS Platforms
Affected OS(s): All OS Platforms
Language Found: English
Description
Steps to reproduce:
In an mx:Form which contains several FormItems whose visibility depends on some logic, when hidden FormItems are displayed the width of the LabelWidth of the Form is not invalidated / recalculated thus truncating the text of the new label (if it's larger than the previously calculated).
Execute the app below:
<?xml version="1.0" encoding="utf-8"?>
<mx:Application
layout="vertical" minWidth="955" minHeight="600"
xmlns:mx="http://www.adobe.com/2006/mxml"
xmlns:local="*"
xmlns:containers="mx.containers.*">
<containers:MyForm id="form"
width="300">
<mx:FormItem
width="100%"
label="My label">
<mx:TextInput width="100%"/>
</mx:FormItem>
<mx:FormItem id="fi"
width="100%"
label="My label long" includeInLayout="
visible="{v.selected}
">
<mx:TextInput width="100%"/>
</mx:FormItem>
</containers:MyForm>
<mx:CheckBox id="v"/>
</mx:Application>
Actual Results:
When selecting / unselecting the checkbox, the second FormItem appears but the text is truncated.
Expected Results
The label should be resized.
Workaround (if any):
There at least a couple of workarounds:
1. Invoke form.styleChanged(null). This will cause invalidateLabelWidth to be invoked
2. Create a subclass of mx:Form in the mx.containers package. Create a public method on it to proxy calls to invalidateLabelWidth. Invoke the public method when needed