Any ideas on this issue? I would like to find workaround or point me
at my mistake...

---------- Forwarded message ----------
From: Sergey Kovalyov <[EMAIL PROTECTED]>
Date: Jul 21, 2006 11:46 PM
Subject: ComboBox dropdown size doesn't change with new dataProvider in state
To: [email protected]


Hi All!

I have ComboBox in state and when I change its dataProvider, where
labels are longer, its dropdown size doesn't change. I attached two
application files and you can also find their source below. Click
"Edit" button first, then "Cancel" and "Edit" again. Dropdown is so
thin.

Test.mxml:

<?xml version="1.0" encoding="utf-8"?>
<TestBase xmlns:mx="http://www.adobe.com/2006/mxml";
        xmlns="*"
        currentState="viewState">

        <states>
                <mx:State name="{VIEW_STATE}">
                        <mx:AddChild relativeTo="{myHBox}" position="lastChild">
                                <mx:target>
                                        <mx:Button label="Edit"
click="onEditButtonClick()" />
                                </mx:target>
                        </mx:AddChild>
                </mx:State>
                <mx:State name="{EDIT_STATE}" enterState="onEditStateEnter()">
                        <mx:AddChild relativeTo="{myHBox}" position="lastChild">
                                <mx:target>
                                        <mx:ComboBox id="myComboBox"
dataProvider="{[1, 2, 3]}" />
                                </mx:target>
                        </mx:AddChild>
                        <mx:AddChild relativeTo="{myHBox}" position="lastChild">
                                <mx:target>
                                        <mx:Button label="Cancel"
click="onCancelButtonClick()" />
                                </mx:target>
                        </mx:AddChild>
                </mx:State>
        </states>

        <mx:HBox id="myHBox" />

</TestBase>



TestBase.as:

package {
        import mx.controls.ComboBox;
        import mx.core.Application;
        import mx.events.FlexEvent;

        public class TestBase extends Application {

                public var myComboBox : ComboBox;

                public static const VIEW_STATE : String = "viewState";

                public static const EDIT_STATE : String = "editState";

                public function TestBase() {
                }

                protected function onEditButtonClick() : void {
                        currentState = EDIT_STATE;
                }

                protected function onCancelButtonClick() : void {
                        currentState = VIEW_STATE;
                        myComboBox.dataProvider = ["Italy", "France",
"Germany"];
                }

                protected function onEditStateEnter() : void {
                        if (myComboBox.initialized) {
                                onEditState();
                        } else {

myComboBox.addEventListener(FlexEvent.CREATION_COMPLETE,
onMyComboBoxCreationComplete);
                        }
                }

                private function onEditState() : void {
                        myComboBox.open();
                }

                private function onMyComboBoxCreationComplete(event :
FlexEvent) : void {
                        onEditState();
                }

        }

}

Thank you in advance!

Regards, Sergey.


------------------------ Yahoo! Groups Sponsor --------------------~--> 
Something is new at Yahoo! Groups.  Check out the enhanced email design.
http://us.click.yahoo.com/SISQkA/gOaOAA/yQLSAA/nhFolB/TM
--------------------------------------------------------------------~-> 

--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/flexcoders/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 

Attachment: Test.mxml
Description: Binary data

Attachment: TestBase.as
Description: Binary data

Reply via email to