4 Replies Latest reply on Feb 27, 2008 4:32 AM by daniel.soneira

    Does RichFaces support "focusing" on elements?

    konstandinos

      Hi

      I'd like to set focus on a particular commandButton.

      eg: I have two commandButtons at the end of a form: "Back" (which goes to the previous section) and "Submit".

      The user types in the form data and hits enter. At this point I want it to submit.

      But because the "Back" button came first in the view tree, it has the default focus (or so it seems). So when my user presses enter, it goes back.

      I want it so that when my user presses enter, it submits.

      I don't even need to dynamically set focus on elements. All I need is to set the default focused button on a page for pressing enter.

      If there is a way to set focus dynamically too then I'd still be interested to learn about it.

      Thanks!