If you do not want to use ADF for this: I think j4j is doing the same:
http://www.jsftutorials.net/defaultActionTag.htmlgreetings, Bjoern Mehner
--------------------------------------------------
Björn Mehner
InterComponentWare AG
Otto-Hahn-Str. 3
D-69190 Walldorf, Germany
Adam Winer <
adam.winer@...> wrote on 22.03.2006 00:08:27:
> Yep, exactly - the form can't figure out what button was pressed.
> There's no magic way for JSF to automatically know what is meant
> by the "default button".
>
> ADF adds a "defaultCommand" property to af:form, so you can have:
>
>
> <af:form defaultCommand="okButton">
> ...
> <h:commandButton id="okButton" value="OK"/>
> ...
> </af:form>
>
> ... and it does the Javascript magic needed to map Enter
> to that button.
>
> -- Adam
>
>
>
bruno@... wrote:
> > When you submit without clicking a button, the form is sent to the
> server by the
> > browser but no HTTP parameter is passed to indicate what button was
clicked
> > (because none was) or it is passed with a blank value (I can't
recall).
> > Therefore, I suppose JSF/Facelets is unable to identify what button
was
> > activated and what action should be triggered. In practice, it
> would be nice if
> > JSF/Facelets handled this behaviour properly and assumed that no
> HTTP param for
> > the button means to behave as if the default button had been clicked.
> >
> > Quoting "Storm, Dan" <
dstorm@...>:
> >
> >> If a text field has focus, the form will submit upon hitting the
enter (or
> >> return) key. This does not seem to work in facelets. Is this a bug in
> >> Facelets and/or should we write some JS?
> >>
> >> dan storm ~ web developer ~
dstorm@... ~ w: 206.266.0292 ~ c:
> >> 425.503.9580
> >>
> >>
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail:
users-unsubscribe@...
> > For additional commands, e-mail:
users-help@...
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
users-unsubscribe@...
> For additional commands, e-mail:
users-help@...
>
---------------------------------------------------------------------
To unsubscribe, e-mail:
users-unsubscribe@...
For additional commands, e-mail:
users-help@...