[
https://issues.apache.org/jira/browse/FLEX-23915?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13864049#comment-13864049
]
João Fernandes commented on FLEX-23915:
---------------------------------------
or we can simply do
override public function invalidateSize():void
{
measuredLabelWidth = NaN;
super.invalidateSize();
}
avoiding child invalidation
> LabelWidth not updating properly in Forms
> -----------------------------------------
>
> Key: FLEX-23915
> URL: https://issues.apache.org/jira/browse/FLEX-23915
> Project: Apache Flex
> Issue Type: Bug
> Components: mx: Form View
> Affects Versions: Adobe Flex SDK 4.0 (Release)
> Environment: Affected OS(s): All OS Platforms
> Affected OS(s): All OS Platforms
> Language Found: English
> Reporter: Adobe JIRA
> Assignee: Adobe JIRA
> Priority: Trivial
>
> 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="{v.selected}"
> 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
--
This message was sent by Atlassian JIRA
(v6.1.5#6160)