You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@flex.apache.org by "Jeremy Wischusen (JIRA)" <ji...@apache.org> on 2013/04/20 15:19:16 UTC

[jira] [Comment Edited] (FLEX-25906) ComboBox textInput not cleared when dataprovider changes

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

Jeremy Wischusen edited comment on FLEX-25906 at 4/20/13 1:18 PM:
------------------------------------------------------------------

This is still occurring using SDK 4.9.1 on Mac OS X 10.7.5. 

<?xml version="1.0"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark">
    <fx:Script>
            <![CDATA[
        import mx.collections.ArrayList;

        [Bindable]
        private var dp1:ArrayList = new ArrayList(['dp1-1', 'dp1-2', 'dp1-3']);
        [Bindable]
        private var dp2:ArrayList = new ArrayList(['dp2-1', 'dp2-2', 'dp2-3']);


        private function switchDP(e:Event):void {
            if (myComboBox.dataProvider == dp1) {
                myComboBox.dataProvider = dp2;
            } else {
                myComboBox.dataProvider = dp1;
            }
        }
        ]]>
        </fx:Script>
    <s:HGroup>
        <s:ComboBox id="myComboBox" dataProvider="{dp1}"/>
        <s:Button id="myButton" click="switchDP(event)" label="Switch Data Providers"/>
    </s:HGroup>
</s:Application>

                
      was (Author: jeremy.wischusen):
    This is still occurring using SDK 4.9.1 on Mac OS X 10.7.5. 
                  
> ComboBox textInput not cleared when dataprovider changes
> --------------------------------------------------------
>
>                 Key: FLEX-25906
>                 URL: https://issues.apache.org/jira/browse/FLEX-25906
>             Project: Apache Flex
>          Issue Type: Bug
>          Components: Spark: ComboBox
>    Affects Versions: Adobe Flex SDK 4.1 (Release)
>         Environment: Affected OS(s): All OS Platforms
> Affected OS(s): All OS Platforms
> Browser: Firefox 3.x
> Language Found: English
>            Reporter: Adobe JIRA
>              Labels: easytest
>
> Steps to reproduce:
> 1.Create a UI containing a spark ComboBox whose dataprovider can change based on user interaction
> 2.Select an item from the combobox
> 3. Change the dataprovider for the combobox to a collection that does not contain the selected item. For example if the selected index was 4 change the dataprovider to a collection with a length of 3 or less.
>  
>  Actual Results: 
> The selectedIndex and selectedItem properties update as expected but the text in the textInput still displays it's original value.
>  
>  
>  Expected Results:
> The text property of the textInput should be cleared or set to null if selectedItem is no longer valid.
>  
>  
>  Workaround (if any):
>  
>  The problem is caused by the fact that the change to the dataprovider causes selectedItem to become undefined before the updateLabelDisplay() method of ComboBox is called. This will result in displayItem being undefined and thus prevent the update to textInput.text on line 677.
> The workaround is to create a component that extends ComboBox and override the commitProperties() function. In the overridden function, check if selectedIndex == -1 and if so manually set the text to "" before calling super.commitProperties.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira