ICEfaces
  1. ICEfaces
  2. ICE-1993

selectInputText: allow different entries with the same label

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.6
    • Fix Version/s: 1.7.2-SP2, 1.8
    • Component/s: ICE-Components
    • Labels:
      None
    • Environment:
      any

      Description

      users want to be able to show different entries with the same label in a selectInputText component, i.e. one would desire to show the following:


      City | State | Country

      Springfield | IL | USA
      Springfield | MA |USA

      trying this with the current release 1.6.0 results always in the last element to be selected in the backing bean code, because
      the values of this component are stored within a map and the map's key is the SelectItems label. When there are more labels
      with equal values only the last one will be stored in this map.

        Issue Links

          Activity

          Michael Thiem created issue -
          Mark Collette made changes -
          Field Original Value New Value
          Link This issue blocks ICE-3734 [ ICE-3734 ]
          Repository Revision Date User Message
          ICEsoft Public SVN Repository #17900 Fri Nov 14 17:54:05 MST 2008 mark.collette ICE-1993 : selectInputText: allow different entries with the same label
          Files Changed
          Commit graph MODIFY /icefaces/trunk/icefaces/component/src/com/icesoft/faces/component/selectinputtext/SelectInputText.java
          Commit graph MODIFY /icefaces/trunk/icefaces/component/src/com/icesoft/faces/component/selectinputtext/SelectInputTextRenderer.java
          Commit graph MODIFY /icefaces/trunk/icefaces/samples/component-showcase/common-src/org/icefaces/application/showcase/view/bean/examples/component/selectInputText/CityDictionary.java
          Commit graph MODIFY /icefaces/trunk/icefaces/bridge/lib/extras/autocomplete_ext.js
          Mark Collette made changes -
          Assignee Mark Collette [ mark.collette ]
          Repository Revision Date User Message
          ICEsoft Public SVN Repository #17905 Mon Nov 17 10:38:16 MST 2008 mark.collette ICE-1993 : selectInputText: allow different entries with the same label
          Files Changed
          Commit graph MODIFY /icefaces/trunk/icefaces/samples/component-showcase/common-src/org/icefaces/application/showcase/view/bean/examples/component/selectInputText/SelectInputTextController.java
          Hide
          Mark Collette added a comment -

          The SelectInputText component no longer keeps a Map of String labels to SelectItem objects. As well, when a list selection is made by the user, the list index is transmitted from the browser, and not just the label. This way, in the textChangeListener and valueChangeListener, SelectInputText.getSelectedItem() can be called, to get the exact selected item, regardless of whether there are entries with duplicated labels.

          The caveat being that, with state saving, the value field of the SelectItem objects needs to be Serializable, or else the selectedItem won't be saved, and it should implement equals(), to be comparable, when de-Serialized to the original SelectItem. Regardless if the selectedItem is state saved, it will at least be valid through the textChangeListener and valueChangeListener invocations, in the lifecycle when the user has selected an entry from the list.

          Because components always resubmit their values for every form submit, including partialSubmits, the SelectInputText component will decode the submitted label each lifecycle, but only decodes the list index selections from user interactions. So, the selectedItem can be lost over subsequent form submits. If there is exactly one matching SelectItem label, the selectedItem will be set to it. But, it will not match if there are duplicate labels, like it used to.

          Subversion 17900
          icefaces\bridge\lib\extras\autocomplete_ext.js
          icefaces\component\src\com\icesoft\faces\component\selectinputtext\SelectInputText.java
          icefaces\component\src\com\icesoft\faces\component\selectinputtext\SelectInputTextRenderer.java
          icefaces\samples\component-showcase\common-src\org\icefaces\application\showcase\view\bean\examples\component\selectInputText\CityDictionary.java

          Subversion 17905
          icefaces\application\showcase\view\bean\examples\component\selectInputText\SelectInputTextController.java

          Show
          Mark Collette added a comment - The SelectInputText component no longer keeps a Map of String labels to SelectItem objects. As well, when a list selection is made by the user, the list index is transmitted from the browser, and not just the label. This way, in the textChangeListener and valueChangeListener, SelectInputText.getSelectedItem() can be called, to get the exact selected item, regardless of whether there are entries with duplicated labels. The caveat being that, with state saving, the value field of the SelectItem objects needs to be Serializable, or else the selectedItem won't be saved, and it should implement equals(), to be comparable, when de-Serialized to the original SelectItem. Regardless if the selectedItem is state saved, it will at least be valid through the textChangeListener and valueChangeListener invocations, in the lifecycle when the user has selected an entry from the list. Because components always resubmit their values for every form submit, including partialSubmits, the SelectInputText component will decode the submitted label each lifecycle, but only decodes the list index selections from user interactions. So, the selectedItem can be lost over subsequent form submits. If there is exactly one matching SelectItem label, the selectedItem will be set to it. But, it will not match if there are duplicate labels, like it used to. Subversion 17900 icefaces\bridge\lib\extras\autocomplete_ext.js icefaces\component\src\com\icesoft\faces\component\selectinputtext\SelectInputText.java icefaces\component\src\com\icesoft\faces\component\selectinputtext\SelectInputTextRenderer.java icefaces\samples\component-showcase\common-src\org\icefaces\application\showcase\view\bean\examples\component\selectInputText\CityDictionary.java Subversion 17905 icefaces\application\showcase\view\bean\examples\component\selectInputText\SelectInputTextController.java
          Mark Collette made changes -
          Status Open [ 1 ] Resolved [ 5 ]
          Fix Version/s 1.8DR#2 [ 10142 ]
          Resolution Fixed [ 1 ]
          Mark Collette made changes -
          Link This issue is duplicated by ICE-2825 [ ICE-2825 ]
          Ken Fyten made changes -
          Salesforce Case []
          Fix Version/s 1.7.3 [ 10162 ]
          Assignee Priority P3
          Hide
          Ken Fyten added a comment -

          Backport to icefaces-1.7 branch.

          Show
          Ken Fyten added a comment - Backport to icefaces-1.7 branch.
          Ken Fyten made changes -
          Resolution Fixed [ 1 ]
          Status Resolved [ 5 ] Reopened [ 4 ]
          Repository Revision Date User Message
          ICEsoft Public SVN Repository #18668 Thu Mar 26 14:14:04 MDT 2009 mark.collette ICE-1993 : selectInputText: allow different entries with the same label
          Backport to ICEfaces 1.7 branch
          Files Changed
          Commit graph MODIFY /icefaces/branches/icefaces-1.7/icefaces/samples/component-showcase/common-src/org/icefaces/application/showcase/view/bean/examples/component/selectInputText/SelectInputTextController.java
          Commit graph MODIFY /icefaces/branches/icefaces-1.7/icefaces/component/src/com/icesoft/faces/component/selectinputtext/SelectInputTextRenderer.java
          Commit graph MODIFY /icefaces/branches/icefaces-1.7/icefaces/samples/component-showcase/common-src/org/icefaces/application/showcase/view/bean/examples/component/selectInputText/CityDictionary.java
          Commit graph MODIFY /icefaces/branches/icefaces-1.7/icefaces/bridge/lib/extras/autocomplete_ext.js
          Commit graph MODIFY /icefaces/branches/icefaces-1.7/icefaces/component/src/com/icesoft/faces/component/selectinputtext/SelectInputText.java
          Hide
          Mark Collette added a comment -

          Backported to ICEfaces 1.7 branch
          Subversion 18668

          Show
          Mark Collette added a comment - Backported to ICEfaces 1.7 branch Subversion 18668
          Mark Collette made changes -
          Status Reopened [ 4 ] Resolved [ 5 ]
          Fix Version/s 1.8DR#2 [ 10142 ]
          Resolution Fixed [ 1 ]
          Ken Fyten made changes -
          Salesforce Case []
          Fix Version/s 1.8 [ 10161 ]
          Assignee Priority P3
          Hide
          Joanne Bai added a comment -

          verified with success on 1.7.2-SP2 build3 (tested on tomcat6 + FF2 and IE6)

          Show
          Joanne Bai added a comment - verified with success on 1.7.2-SP2 build3 (tested on tomcat6 + FF2 and IE6)
          Ken Fyten made changes -
          Status Resolved [ 5 ] Closed [ 6 ]
          Assignee Mark Collette [ mark.collette ]
          Repository Revision Date User Message
          ICEsoft Public SVN Repository #24353 Wed Apr 06 09:40:02 MDT 2011 yip.ng ICE-6317: Regression: ICE-1993 dropdown list works only the first time.
          Files Changed
          Commit graph MODIFY /icefaces2/branches/icefaces-2.0.x-maintenance/icefaces/compat/core/src/main/javascript/extras/extras.js
          Repository Revision Date User Message
          ICEsoft Public SVN Repository #24354 Wed Apr 06 09:47:35 MDT 2011 yip.ng ICE-6317: Regression: ICE-1993 dropdown list works only the first time.
          Files Changed
          Commit graph MODIFY /icefaces2/trunk/icefaces/compat/core/src/main/javascript/extras/extras.js
          Repository Revision Date User Message
          ICEsoft Public SVN Repository #31506 Tue Oct 16 12:12:23 MDT 2012 yip.ng ICE-8616: REGRESSIONS - ICE-1993 fails in Firefox and Chrome (ice:selectInputText).
          Files Changed
          Commit graph MODIFY /icefaces3/trunk/icefaces/compat/components/src/main/java/com/icesoft/faces/component/selectinputtext/SelectInputTextRenderer.java

            People

            • Assignee:
              Unassigned
              Reporter:
              Michael Thiem
            • Votes:
              5 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: