I'm building a mx:Panel with two buttons (Login and Register)
and two states (base and "register"). In the "base" state, I set
Login Button as the default button. In the "register" state, I set
Register Button as the default button. The base state has two text
input fields: userid and password. The "register" state has userid
and password plus other fields for personal data. All the fields
are checked by Validators before submitting to server. A
mx:LinkButton is used to change states.
When there were no data entered and I submitted the form, I
got warning from the Validators. After I did it for both states and
if I pressed the Enter key again, the state is changed just like
clicking the LinkButton. It should display warnings, not causing
state change. It seems the LinkButton becomes the defaultButton.
When I took away the defaultButton settings, the problem goes
I'm posting this to see if others have seen the same problem.
I hope I did something wrong, but it looks like a bug. I
still want to use the defaultButton, is there any workaround?
The defaultButton in a container can change if focus moves to
another button. Check that you are not moving to the link button
somehow after pressing enter (set the linkbutton:tabEnabled
=false), which then becomes the defaultButton.
I tried tabEnable="false" with LinkButton, but still get the
same behave. tabEnable="false" only causes tab to skip the
LinkButton. How to remove the focus from LinkButton automatically
after it is clicked?
After removing the defaultButton, the Enter key does not
cause submitting at all even the focus is on the Login or Register