ICEfaces
  1. ICEfaces
  2. ICE-10416

noSelectionOption doesn't work in ace:selectMenu, ace:comboBox, and ace:simpleSelectOneMenu components

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 4.0
    • Fix Version/s: EE-4.0.0.GA, 4.1
    • Component/s: ACE-Components
    • Labels:
      None
    • Environment:
      Tested on Tomcat
    • Assignee Priority:
      P1

      Description

      <h:form>
        <ace:simpleSelectOneMenu id="countryIn" value="#{dataBean.country}" required="true">
            <f:selectItem itemValue="" itemLabel="--Select--" noSelectionOption="true"/>
            <f:selectItem itemValue="1" itemLabel="Canada"/>
        </ace:simpleSelectOneMenu>
        <h:message for="countryIn"/>
        <h:commandButton value="Submit" actionListener="#{formBean.submit}"/>
      </h:form>

      When an f:selectItem with noSelectionOption="true" is used as a default value for an ace:simpleSelectOneMenu (with required="true"), if the user selects it and submits the form the field isn't considered invalid. So the noSelectionOption doesn't appear to work with ace:simpleSelectOneMenu.
      This behaviour should be the same as h:selectOneMenu, where we would see the standard validation message ("Required value...").

      Other selection components that use SelectItem's, like ace:selectMenu and ace:comboBox, should also support the noSelectionOption attribute, if appropriate.

        Activity

        Carlo Guglielmin created issue -
        Ken Fyten made changes -
        Field Original Value New Value
        Assignee Arturo Zambrano [ artzambrano ]
        Fix Version/s EE-4.0.0.GA [ 11171 ]
        Assignee Priority P1 [ 10010 ]
        Repository Revision Date User Message
        ICEsoft Public SVN Repository #43643 Wed Dec 03 17:07:37 MST 2014 art.zambrano ICE-10416 added support for noSelectionOption in ace:simpleSelectOneMenu
        Files Changed
        Commit graph MODIFY /icefaces4/trunk/icefaces/ace/component/src/org/icefaces/ace/component/simpleselectonemenu/SimpleSelectOneMenu.java
        Hide
        Arturo Zambrano added a comment -

        Committed fix to 4.0 trunk at revision 43643. Added support for noSelectionOption in ace:simpleSelectOneMenu.

        Testing notes: according to the JSF documentation, noSelectionOption="true" in f:selectItem should cause a validation error if the item is selected AND the component is using required="true".

        Show
        Arturo Zambrano added a comment - Committed fix to 4.0 trunk at revision 43643. Added support for noSelectionOption in ace:simpleSelectOneMenu. Testing notes: according to the JSF documentation, noSelectionOption="true" in f:selectItem should cause a validation error if the item is selected AND the component is using required="true".
        Arturo Zambrano made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Repository Revision Date User Message
        ICEsoft Public SVN Repository #43653 Thu Dec 04 17:53:24 MST 2014 art.zambrano ICE-10416 modified logic used to determine whether to mark component invalid or not, depending on whether it is required
        Files Changed
        Commit graph MODIFY /icefaces4/trunk/icefaces/ace/component/src/org/icefaces/ace/component/simpleselectonemenu/SimpleSelectOneMenu.java
        Hide
        Arturo Zambrano added a comment -

        r43653: modified logic used to determine whether to mark component invalid or not, depending on whether it is required.

        Show
        Arturo Zambrano added a comment - r43653: modified logic used to determine whether to mark component invalid or not, depending on whether it is required.
        Arturo Zambrano made changes -
        Summary ace:simpleSelectOneMenu doesn't work with noSelectionOption noSelectionOption doesn't work in selection components
        Description <h:form>
          <ace:simpleSelectOneMenu id="countryIn" value="#{dataBean.country}" required="true">
              <f:selectItem itemValue="" itemLabel="--Select--" noSelectionOption="true"/>
              <f:selectItem itemValue="1" itemLabel="Canada"/>
          </ace:simpleSelectOneMenu>
          <h:message for="countryIn"/>
          <h:commandButton value="Submit" actionListener="#{formBean.submit}"/>
        </h:form>

        When an f:selectItem with noSelectionOption="true" is used as a default value for an ace:simpleSelectOneMenu (with required="true"), if the user selects it and submits the form the field isn't considered invalid. So the noSelectionOption doesn't appear to work with ace:simpleSelectOneMenu.
        This behaviour should be the same as h:selectOneMenu, where we would see the standard validation message ("Required value...").
        <h:form>
          <ace:simpleSelectOneMenu id="countryIn" value="#{dataBean.country}" required="true">
              <f:selectItem itemValue="" itemLabel="--Select--" noSelectionOption="true"/>
              <f:selectItem itemValue="1" itemLabel="Canada"/>
          </ace:simpleSelectOneMenu>
          <h:message for="countryIn"/>
          <h:commandButton value="Submit" actionListener="#{formBean.submit}"/>
        </h:form>

        When an f:selectItem with noSelectionOption="true" is used as a default value for an ace:simpleSelectOneMenu (with required="true"), if the user selects it and submits the form the field isn't considered invalid. So the noSelectionOption doesn't appear to work with ace:simpleSelectOneMenu.
        This behaviour should be the same as h:selectOneMenu, where we would see the standard validation message ("Required value...").

        Other selection components that use SelectItem's, like ace:selectMenu and ace:comboBox, should also support the noSelectionOption attribute, if appropriate.
        Repository Revision Date User Message
        ICEsoft Public SVN Repository #43654 Fri Dec 05 14:14:27 MST 2014 art.zambrano ICE-10416 fix to allow submitting null values, mimicking h:selectOneMenu behaviour
        Files Changed
        Commit graph MODIFY /icefaces4/trunk/icefaces/ace/component/src/org/icefaces/ace/component/simpleselectonemenu/SimpleSelectOneMenuRenderer.java
        Commit graph MODIFY /icefaces4/trunk/icefaces/ace/component/src/org/icefaces/ace/component/simpleselectonemenu/SimpleSelectOneMenu.java
        Repository Revision Date User Message
        ICEsoft Public SVN Repository #43804 Tue Dec 09 12:17:45 MST 2014 art.zambrano ICE-10416 fixes for ace:selectMenu and ace:comboBox
        Files Changed
        Commit graph MODIFY /icefaces4/trunk/icefaces/ace/component/src/org/icefaces/ace/component/selectmenu/SelectMenu.java
        Commit graph MODIFY /icefaces4/trunk/icefaces/ace/component/src/org/icefaces/ace/component/combobox/ComboBoxRenderer.java
        Hide
        Arturo Zambrano added a comment -

        r43804: committed fixes for ace:selectMenu and ace:comboBox.

        Show
        Arturo Zambrano added a comment - r43804: committed fixes for ace:selectMenu and ace:comboBox.
        Ken Fyten made changes -
        Issue Type Bug [ 1 ] Improvement [ 4 ]
        Hide
        Liana Munroe added a comment -

        Tested with ICEfaces 4 trunk r43806. Tomcat 7 IE 11, FF 33, Chrome 39. There are no issues found with simpleSelectOneMenu or comboBox.
        When testing selectMenu using a noSelectionOption="true" and required=false, a validation message still appears when submitting the form. If pressing submit a second time the validation message is removed. This is not an issue with simpleSelectOneMenu or comboBox.

        QA Test app (/ICE-10416.jsf ) added to the following:
        http://dev.icesoft.com/svn/repo/qa/trunk/Regression-Icefaces4/Sparkle/Nightly/simpleSelectOneMenu
        http://dev.icesoft.com/svn/repo/qa/trunk/Regression-Icefaces4/Sparkle/Nightly/selectMenu
        http://dev.icesoft.com/svn/repo/qa/trunk/Regression-Icefaces4/Sparkle/Nightly/comboBox

        Show
        Liana Munroe added a comment - Tested with ICEfaces 4 trunk r43806. Tomcat 7 IE 11, FF 33, Chrome 39. There are no issues found with simpleSelectOneMenu or comboBox. When testing selectMenu using a noSelectionOption="true" and required=false, a validation message still appears when submitting the form. If pressing submit a second time the validation message is removed. This is not an issue with simpleSelectOneMenu or comboBox. QA Test app (/ ICE-10416 .jsf ) added to the following: http://dev.icesoft.com/svn/repo/qa/trunk/Regression-Icefaces4/Sparkle/Nightly/simpleSelectOneMenu http://dev.icesoft.com/svn/repo/qa/trunk/Regression-Icefaces4/Sparkle/Nightly/selectMenu http://dev.icesoft.com/svn/repo/qa/trunk/Regression-Icefaces4/Sparkle/Nightly/comboBox
        Liana Munroe made changes -
        Attachment selectMenu.PNG [ 17698 ]
        Ken Fyten made changes -
        Resolution Fixed [ 1 ]
        Status Resolved [ 5 ] Reopened [ 4 ]
        Repository Revision Date User Message
        ICEsoft Public SVN Repository #43884 Thu Jan 08 13:51:44 MST 2015 art.zambrano ICE-10416 added logic to cover the case where SelectItem's have their label specified but no value
        Files Changed
        Commit graph MODIFY /icefaces4/trunk/icefaces/ace/component/src/org/icefaces/ace/component/selectmenu/SelectMenuRenderer.java
        Commit graph MODIFY /icefaces4/trunk/icefaces/ace/component/resources/icefaces.ace/selectmenu/selectmenu.js
        Hide
        Arturo Zambrano added a comment -

        Committed fix to 4.0 trunk at revision 43884.

        This issue was seen because the select item with noSelectionOption="true" didn't have a value specified. So, this fix consisted in adding some logic to cover the case where SelectItem's have their label specified but no value.

        Testing notes: Please run regression tests.

        Show
        Arturo Zambrano added a comment - Committed fix to 4.0 trunk at revision 43884. This issue was seen because the select item with noSelectionOption="true" didn't have a value specified. So, this fix consisted in adding some logic to cover the case where SelectItem's have their label specified but no value. Testing notes: Please run regression tests.
        Arturo Zambrano made changes -
        Status Reopened [ 4 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Ken Fyten made changes -
        Summary noSelectionOption doesn't work in selection components noSelectionOption doesn't work in ace:selectMenu, ace:comboBox, and ace:simpleSelectOneMenu components
        Hide
        Liana Munroe added a comment -

        Verified ICEfaces 4 trunk r43886. Tomcat 7, IE 11, FF 34, Chrome 39.

        Show
        Liana Munroe added a comment - Verified ICEfaces 4 trunk r43886. Tomcat 7, IE 11, FF 34, Chrome 39.
        Ken Fyten made changes -
        Fix Version/s 4.1 [ 11375 ]
        Ken Fyten made changes -
        Status Resolved [ 5 ] Closed [ 6 ]

          People

          • Assignee:
            Arturo Zambrano
            Reporter:
            Carlo Guglielmin
          • Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: