flex-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From João Fernandes (JIRA) <j...@apache.org>
Subject [jira] [Commented] (FLEX-23915) LabelWidth not updating properly in Forms
Date Tue, 07 Jan 2014 09:55:50 GMT

    [ https://issues.apache.org/jira/browse/FLEX-23915?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13864047#comment-13864047

João Fernandes commented on FLEX-23915:

Could we fix this? this is has a simple fix which is overriding the invalidateSize() in mx:Form
and set 

override public function invalidateSize():void

this happens everytime a formItem has includedInLayout false when added to the form.Since
invalidateLabelWidth(); is internal, we need to create a Class within mx.containers, monkeypatch
mx:Form or re-implement the logic in a custom class.

> 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
> 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
>  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

View raw message