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

          Deryk Sinotte created issue -
          Deryk Sinotte made changes -
          Field Original Value New Value
          Salesforce Case []
          Component/s Bridge [ 10011 ]
          Fix Version/s 2.0-Alpha3 [ 10032 ]
          Assignee Ken Fyten [ ken.fyten ]
          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.
          Ken Fyten made changes -
          Assignee Ken Fyten [ ken.fyten ] Mircea Toma [ mircea.toma ]
          Mircea Toma made changes -
          Link This issue depends on ICE-5574 [ ICE-5574 ]
          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.
          Mircea Toma made changes -
          Status Open [ 1 ] Resolved [ 5 ]
          Resolution Fixed [ 1 ]
          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.
          Deryk Sinotte made changes -
          Resolution Fixed [ 1 ]
          Status Resolved [ 5 ] Reopened [ 4 ]
          Assignee Priority P2
          Deryk Sinotte made changes -
          Salesforce Case []
          Fix Version/s 2.0-Beta2 [ 10242 ]
          Fix Version/s 2.0-Alpha3 [ 10032 ]
          Mircea Toma made changes -
          Link This issue is duplicated by ICE-6014 [ ICE-6014 ]
          Repository Revision Date User Message
          ICEsoft Public SVN Repository #22286 Wed Sep 08 07:11:27 MDT 2010 mircea.toma ICE-5536, ICE-6014 Cancel default action and event bubbling to avoid double submit.
          Files Changed
          Commit graph MODIFY /icefaces2/trunk/icefaces/core/src/main/javascript/submit.js
          Repository Revision Date User Message
          ICEsoft Public SVN Repository #22287 Wed Sep 08 07:38:46 MDT 2010 mircea.toma ICE-5536 Cancel default action only for enter key press.
          Files Changed
          Commit graph MODIFY /icefaces2/trunk/icefaces/core/src/main/javascript/submit.js
          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.
          Mircea Toma made changes -
          Status Reopened [ 4 ] Resolved [ 5 ]
          Resolution Fixed [ 1 ]
          Ken Fyten made changes -
          Fix Version/s 2.0.0 [ 10230 ]
          Ken Fyten made changes -
          Status Resolved [ 5 ] Closed [ 6 ]
          Assignee Priority P2

            People

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

              Dates

              • Created:
                Updated:
                Resolved: