I just noticed some very strange behavior (using IE) regarding buttons:
If I have a single <h:inputText> field and a single <h:commandButton>,
then hitting enter seems to invoke something (because the window
flickers), but the commandButton's action does not get fired.
However, if a add a second <h:inputText> field, even if it has no
associated action, then, if I enter something in the first <h:inputText>
field and hit enter, the <h:commandButton>'s action gets fired.
Summary:
One (or zero) entry box ==> hitting enter doesn't do anything
two entry boxes (or a table of check boxes) ==> hitting enter
causes the command button's action to fire
This is certainly strange. Just to make sure, I did the following:
Created a screen with just a textArea and a commandButton ==>
hitting enter didn't do anything
Then added an empty inputText ==> hitting enter didn't do
anything
Then added another empty inputText ==> hitting enter fired the
commandButton's action
Does anyone else notice this behavior?
- Brendan
-----Original Message-----
From: Travis Reeder [mailto:[EMAIL PROTECTED]
Sent: Wednesday, September 28, 2005 11:30 AM
To: MyFaces Discussion
Subject: Re: Having a "Default" commandButton
I don't think there is one in MyFaces, but there probably should be
something in tomahawk that can do this. I noticed this one a bit ago:
http://www.jsftutorials.net/defaultActionTag.html that does this.
Travis
On 9/28/05, CONNER, BRENDAN (SBCSI) <[EMAIL PROTECTED]> wrote:
> Is there a way to specify one's <h:commandButton> so it is the
"default"
> button? In other words, is there a way to specify it such that it is
> clicked when the user hits the "enter" key?
>
> Also, on a related note, is there a way to specify an <h:inputText>
such
> that the cursor gets placed there automatically when the page loads,
> rather than requiring the user to first click on the text box before
> typing?
>
> - Brendan
>