ICEfaces
  1. ICEfaces
  2. ICE-5536

The action method of two components are called when Enter key is pressed

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.0-Alpha2
    • Fix Version/s: 2.0-Beta2, 2.0.0
    • Labels:
      None
    • Environment:
      ICEfaces 2 Compatibility

      Description

      Given a simple test case like this:

      <ice:form>
          <ice:inputText value="BLAH" action="#{simple.textAction}"/><br/>
          <ice:commandButton value="Click" action="#{simple.buttonAction}"/><br/>
      </ice:form>

      If you focus the inputText field and hit the Enter key, the action methods of both the inputText component and the commandButton are called. This behaviour is different from ICEfaces 1.8 where only the action of the inputText field would be called.

        Issue Links

          Activity

          Hide
          Ted Goddard added a comment -

          Standard browser behavior is to click on a random button within the form to submit via enter key. This is not the behavior of ICEfaces 1.x, so we should describe that mechanism (likely JavaScript implementation) here.

          Show
          Ted Goddard added a comment - Standard browser behavior is to click on a random button within the form to submit via enter key. This is not the behavior of ICEfaces 1.x, so we should describe that mechanism (likely JavaScript implementation) here.
          Hide
          Mircea Toma added a comment -

          The fix for ICE-5574 solved this issue. Now the enter key press is captured in the form element, the element that triggered the event is used when ice.submit is invoked. This way only the triggering element is serialized along with the rest of the form non-submitting elements.

          Show
          Mircea Toma added a comment - The fix for ICE-5574 solved this issue. Now the enter key press is captured in the form element, the element that triggered the event is used when ice.submit is invoked. This way only the triggering element is serialized along with the rest of the form non-submitting elements.
          Hide
          Deryk Sinotte added a comment -

          Re-opening as the behaviour is back. Create a simple compat page with the code in the description, you can see both actions being called when the Enter key is pressed while focus is in the inputText field.

          Show
          Deryk Sinotte added a comment - Re-opening as the behaviour is back. Create a simple compat page with the code in the description, you can see both actions being called when the Enter key is pressed while focus is in the inputText field.
          Hide
          Mircea Toma added a comment - - edited

          Modified ice.s and ice.ss functions to cancel the default action when enter key is pressed. This way the event won't trigger a form submit anymore.

          Show
          Mircea Toma added a comment - - edited Modified ice.s and ice.ss functions to cancel the default action when enter key is pressed. This way the event won't trigger a form submit anymore.

            People

            • Assignee:
              Mircea Toma
              Reporter:
              Deryk Sinotte
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: