-----Original Message-----
From: [email protected] [mailto:[EMAIL PROTECTED] On
Behalf Of Andrea Varga
Sent: Thursday, May 18, 2006 3:59 AM
To: [email protected]
Subject: [flexcoders] Form Submit on Enter Key problem in TabNavigator
Hi All,
I want to submit a form when a user presses the Enter key.
As I understand from the help that I should use the defaultButton
property of the Form. It works well, unless I place my form inide a
TabNavigator.
Below is my very simple example/test/demo code.
Click inside the input field in the first form and hit Enter => Alert
Click inside the input field in the TabNavigator and hit Enter =>
nothing (clcik on the Submit button => Alert) (I am using Flex2B3)
main.mxml:
-----------
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
layout="absolute" xmlns:ns1="*">
<mx:HBox>
<ns1:FormSubmitOnEnter/>
<mx:TabNavigator>
<mx:Canvas>
<ns1:FormSubmitOnEnter/>
</mx:Canvas>
</mx:TabNavigator>
</mx:Box>
</mx:Application>
FormSubmitOnEnter.mxml:
---------------------------
<?xml version="1.0" encoding="utf-8"?>
<mx:Canvas xmlns:mx="http://www.adobe.com/2006/mxml" width="400"
height="300">
<mx:Script>
<![CDATA[
import mx.controls.Alert;
public function doSubmit():void {
Alert.show("Submit", "", Alert.OK);
}
]]>
</mx:Script>
<mx:Form x="0" y="0" id="myForm" defaultButton="{submitFormButton}">
<mx:FormItem label="Name: " id="formitem1">
<mx:TextInput id="nameInput" text=""/>
</mx:FormItem>
<mx:FormItem>
<mx:Button label="Submit" click="doSubmit()"
id="submitFormButton"/>
</mx:FormItem>
</mx:Form>
</mx:Canvas>
How should I solve this?
Thanks
Andi
------------------------ Yahoo! Groups Sponsor --------------------~-->
You can search right from your browser? It's easy and it's free. See
how.
http://us.click.yahoo.com/_7bhrC/NGxNAA/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
--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com
SPONSORED LINKS
| Web site design development | Computer software development | Software design and development |
| Macromedia flex | Software development best practice |
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.

