I am trying to set default button property in TitleWindow. Default
button is not selected and hitting ENTER is not working.

Code below : Main.mxml
<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009";
                           xmlns:s="library://ns.adobe.com/flex/spark"
                           xmlns:mx="library://ns.adobe.com/flex/mx">

        <fx:Script>
                <![CDATA[

                        import mx.managers.PopUpManager;

                        private function open():void {
                                var test:DefaultButton =
DefaultButton(PopUpManager.createPopUp(this, DefaultButton, true));
                                PopUpManager.centerPopUp(test);
                        }

                ]]>
        </fx:Script>

        <s:layout>
                <s:HorizontalLayout/>
        </s:layout>

        <mx:Button label="TEST" click="open()"/>

</s:Application>


/// DefaultButton.mxml
<?xml version="1.0" encoding="utf-8"?>
<mx:TitleWindow xmlns:fx="http://ns.adobe.com/mxml/2009";
                           xmlns:s="library://ns.adobe.com/flex/spark"
                           xmlns:mx="library://ns.adobe.com/flex/mx"
                           defaultButton="{close}">

        <fx:Script>
                <![CDATA[

                        import mx.managers.PopUpManager;

                        private function remove():void {
                                PopUpManager.removePopUp(this);
                        }

                ]]>
        </fx:Script>

        <mx:Label text="Hi"/>

        <mx:Button id="close" label="Close" click="remove()"/>

</mx:TitleWindow>


Please help me to resolve this. Thanks.

-- 
You received this message because you are subscribed to the Google Groups "Flex 
India Community" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/flex_india?hl=en.

Reply via email to