Unfortunately defaultButton click event handler is not fired until user
click on TitleWindow instance, where the container (e.g. Form instance) with
defaultButton attribute defined is located. Even when focus is set on
TextInput instance inside the Form instance using
formItemInstance.setFocus(). On the other hand, when I display either
TitleWindow or Panel in the "root of application", not as a popup,
everything works okay. I provide two MXMLs code below in order to be more
understandable.
Could you please help me with this issue?
Regards, Sergey.
Launcher.mxml:
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx=" http://www.macromedia.com/2003/mxml"
creationComplete="initLauncher()">
<mx:Script>
<![CDATA[
import mx.managers.PopUpManager ;
function initLauncher() {
var formWindow = PopUpManager.createPopUp(this, FormWindow, true);
}
]]>
</mx:Script>
</mx:Application>
FormWindow.mxml :
<?xml version="1.0" encoding="utf-8"?>
<mx:TitleWindow
xmlns:mx="http://www.macromedia.com/2003/mxml"
creationComplete="applicationInit()">
<mx:Script>
<![CDATA[
function applicationInit () {
myStatus.text = "Ready";
myField.setFocus();
}
function updateStatus () {
myStatus.text = "'Go' Clicked";
}
function resetStatus () {
myStatus.text = "";
}
]]>
</mx:Script>
<mx:Form defaultButton="myButton">
<mx:FormItem label="My Field">
<mx:TextInput id="myField" />
</mx:FormItem>
<mx:FormItem label="Another Field">
<mx:TextInput id="anotherField" />
</mx:FormItem>
<mx:FormItem label="My Status">
<mx:Label id="myStatus" />
</mx:FormItem>
</mx:Form>
<mx:ControlBar>
<mx:Button id="myButton" label="Go" click="updateStatus()"/>
<mx:Button id="resetButton" label="Reset" click="resetStatus()"/>
</mx:ControlBar>
</mx:TitleWindow>
--
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
- Visit your group "flexcoders" on the web.
- To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
- Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
Launcher.mxml
Description: Binary data
FormWindow.mxml
Description: Binary data

