Uploaded image for project: 'RichFaces'
  1. RichFaces
  2. RF-1657

Submit form by pressing enter key

    Details

    • Type: Feature Request
    • Status: Resolved (View Workflow)
    • Priority: Major
    • Resolution: Rejected
    • Affects Version/s: 3.2.0
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None

      Description

      Please add support for form submits by pressing the enter key. This is a very common design and usability pattern.
      Forcing users to switch between mouse and keyboard is not quite "user-friendly".

        Gliffy Diagrams

          Activity

          Hide
          roku Rolf Kulemann added a comment -

          I would very appreciate this feature, or better said, standard behavior. I ported a quite large MyFaces app to a4j and richfaces and users still expect the enter key to submit the form.

          Show
          roku Rolf Kulemann added a comment - I would very appreciate this feature, or better said, standard behavior. I ported a quite large MyFaces app to a4j and richfaces and users still expect the enter key to submit the form.
          Hide
          roku Rolf Kulemann added a comment -

          The reason why a from is not submitted on pressing enter is, that a4j:commandButton is not rendered as type sbmit, but as type button.

          Show
          roku Rolf Kulemann added a comment - The reason why a from is not submitted on pressing enter is, that a4j:commandButton is not rendered as type sbmit, but as type button.
          Hide
          roku Rolf Kulemann added a comment -

          To get the default behavior for submit on enter, one should use the type attribute for a4j:commandButton.

          Sample:

          <a4j:commandButton type="submit" ...../>

          Unfortunately, the tag docu of the a4j:commandButton sais, that type="submit" is default. Im my case all buttons are rendered as type button by default.

          Show
          roku Rolf Kulemann added a comment - To get the default behavior for submit on enter, one should use the type attribute for a4j:commandButton. Sample: <a4j:commandButton type="submit" ...../> Unfortunately, the tag docu of the a4j:commandButton sais, that type="submit" is default. Im my case all buttons are rendered as type button by default.
          Hide
          Alexander Kiselyov Alexander Kiselyov added a comment -

          I've found a hack solution for this problem. If you'll enclose <h:commandButton> in <div></div> tag, this will cause such button to be default on pressing 'Enter' key. (Note: I using Seam Runtime 2.0.2.SP1, it works in Firefox 3.0.3, IE 6.0.2800. When I added additional component into <div> (h:commandLink) behavior after Enter key pressing became unspecified)
          E.g.:
          <h:form>
          <!-- some controls... -->
          <div>
          <h:commandButton value="Submit"
          id="submitButton"
          action="#

          {myController.buttonAction()}

          " />
          </div>
          <!-- other controls... -->
          </h:form>

          Show
          Alexander Kiselyov Alexander Kiselyov added a comment - I've found a hack solution for this problem. If you'll enclose <h:commandButton> in <div></div> tag, this will cause such button to be default on pressing 'Enter' key. (Note: I using Seam Runtime 2.0.2.SP1, it works in Firefox 3.0.3, IE 6.0.2800. When I added additional component into <div> (h:commandLink) behavior after Enter key pressing became unspecified) E.g.: <h:form> <!-- some controls... --> <div> <h:commandButton value="Submit" id="submitButton" action="# {myController.buttonAction()} " /> </div> <!-- other controls... --> </h:form>
          Hide
          ilya_shaikovsky Ilya Shaikovsky added a comment -

          just use type="submit"
          we will not change the default type because of backward compatibility.

          Show
          ilya_shaikovsky Ilya Shaikovsky added a comment - just use type="submit" we will not change the default type because of backward compatibility.

            People

            • Assignee:
              nbelaevski Nick Belaevski
              Reporter:
              calab Carsten Labinsky
            • Votes:
              9 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development