ICEfaces
  1. ICEfaces
  2. ICE-5574

Make behavior uniform across all browser for "submit on enter" with input components

    Details

    • Type: New Feature New Feature
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.0-Alpha2
    • Fix Version/s: 2.0-Alpha3, 2.0.0
    • Component/s: Bridge
    • Labels:
      None
    • Environment:
      ICEfaces 2.0 Alpha2 / JSF 2.

      Description

      In ICEfaces 1.x the doSubmit() function in the bridge would block the default submit on enter functionality that is present in some browsers when Enter is pressed inside an HTML input element. We need a similar mechanism for ICEfaces 2.0, to allow the components themselves full control over submit processing as triggered by the enter key.

        Issue Links

          Activity

          Hide
          Mircea Toma added a comment - - edited

          All h:* components work properly, including h:commandButton and h:commandLink. "repo\qa\trunk\Regression-Icefaces2\ICE-5574" test is using forward navigation for h:commandButton and h:commandLink when successfully submitted. But there seems to be a bug with navigation in JSF 2.0.2 because the javax.faces.ViewState hidden input fields belonging to the forms are missing after navigation is executed (hence oldDOM = null).
          Modifying the test to have h:commandLink and h:commandButton increment an associated counter instead of running navigation rules shows that these components work as well.

          Show
          Mircea Toma added a comment - - edited All h:* components work properly, including h:commandButton and h:commandLink. "repo\qa\trunk\Regression-Icefaces2\ ICE-5574 " test is using forward navigation for h:commandButton and h:commandLink when successfully submitted. But there seems to be a bug with navigation in JSF 2.0.2 because the javax.faces.ViewState hidden input fields belonging to the forms are missing after navigation is executed (hence oldDOM = null). Modifying the test to have h:commandLink and h:commandButton increment an associated counter instead of running navigation rules shows that these components work as well.
          Hide
          Mircea Toma added a comment -

          As for ice:* components here are my discoveries:

          1) ice:selectManyCheckbox – indeed the NullPointerException is present, looking at the renderer code it is obvious that when a SelectItemGroup is nested the markup generation is wrong. I'll attach a patch to this case for com.icesoft.faces.renderkit.dom_html_basic.SelectManyCheckboxListRenderer.

          2) Following components work as expected as long "partialSubmit" attribute is removed:
          selectBooleanCheckbox
          selectManyListbox
          selectManyMenu
          selectOneListbox
          selectOneMenu
          selectOneRadio

          3) ice:commandLink is not working because the rendered anchor normally changes the value of a hidden input element (in the event handler) just before invoking iceSubmit. When Enter key is pressed iceSubmit will serialize the hidden input field, but its value is not changed as required.
          I guess the solution would be to change renderer's decode method to not rely on the named input hidden field.

          Show
          Mircea Toma added a comment - As for ice:* components here are my discoveries: 1) ice:selectManyCheckbox – indeed the NullPointerException is present, looking at the renderer code it is obvious that when a SelectItemGroup is nested the markup generation is wrong. I'll attach a patch to this case for com.icesoft.faces.renderkit.dom_html_basic.SelectManyCheckboxListRenderer. 2) Following components work as expected as long "partialSubmit" attribute is removed: selectBooleanCheckbox selectManyListbox selectManyMenu selectOneListbox selectOneMenu selectOneRadio 3) ice:commandLink is not working because the rendered anchor normally changes the value of a hidden input element (in the event handler) just before invoking iceSubmit. When Enter key is pressed iceSubmit will serialize the hidden input field, but its value is not changed as required. I guess the solution would be to change renderer's decode method to not rely on the named input hidden field.
          Hide
          Mircea Toma added a comment -

          Changed submit code to avoid form submission when Enter key is pressed in textarea elements. The affected components, h:inputTextarea and ice:inputTextarea, are not going to submit the form on Enter.

          Show
          Mircea Toma added a comment - Changed submit code to avoid form submission when Enter key is pressed in textarea elements. The affected components, h:inputTextarea and ice:inputTextarea, are not going to submit the form on Enter.
          Hide
          Ken Fyten added a comment -

          Follow-up JIRAs created for issue #1, ice:selectManyCheckbox (ICE-5672), and issue #3, ice:commandLink (ICE-5673) above.

          Marking fixed.

          Show
          Ken Fyten added a comment - Follow-up JIRAs created for issue #1, ice:selectManyCheckbox (ICE-5672), and issue #3, ice:commandLink (ICE-5673) above. Marking fixed.
          Hide
          Ken Fyten added a comment -

          Another follow-up issue from this JIRA: ICE-6014.

          Show
          Ken Fyten added a comment - Another follow-up issue from this JIRA: ICE-6014 .

            People

            • Assignee:
              Mircea Toma
              Reporter:
              Ken Fyten
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: