ICEfaces
  1. ICEfaces
  2. ICE-6107

Can't send in an array of objects as the values for a selectOneMenu component

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.0-Beta1, 2.0-Beta2
    • Fix Version/s: 2.0.0
    • Component/s: ICE-Components
    • Labels:
      None
    • Environment:
      jsf2.0, ICEfaces-2.0
    • Affects:
      Documentation (User Guide, Ref. Guide, etc.)
    • Workaround Exists:
      Yes
    • Workaround Description:
      Hide
      Use a list/array that consists of SelectItem objects.

      For Example:
              cityList = new ArrayList<SelectItem>();
              cityList.add(new SelectItem("TORONTO", "TORONTO"));
              cityList.add(new SelectItem("CALGARY", "CALGARY"));
      Show
      Use a list/array that consists of SelectItem objects. For Example:         cityList = new ArrayList<SelectItem>();         cityList.add(new SelectItem("TORONTO", "TORONTO"));         cityList.add(new SelectItem("CALGARY", "CALGARY"));

      Description

      With the JSF <h:selectOneMenu> component, you can use an array of objects for the selectOneMenu options. Using the same set of objects for an <ice:selectOneMenu> does not show the options. For example:

      JSF Component Code:
      <h:selectOneMenu value="#{backingBean.city}" >
           <f:selectItems value="#{backingBean.cities}"/>
      </h:selectOneMenu>

      Backing Bean Code:
      public City[] getCities() {
              return City.values();
      }

      Testing with ICEfaces 1.8.x and JSF 1.2 showed that the array of objects does not work for both the JSF and ICEfaces components. It looks like something was changed on the JSF component and this has not been changed with the ICEfaces components.

        Issue Links

          Activity

          Judy Guglielmin created issue -
          Hide
          Judy Guglielmin added a comment -

          example from the forum posting reference that shows converter issue on <ice:panelTabSet>

          Show
          Judy Guglielmin added a comment - example from the forum posting reference that shows converter issue on <ice:panelTabSet>
          Judy Guglielmin made changes -
          Field Original Value New Value
          Attachment jsf.zip [ 12607 ]
          Arran Mccullough made changes -
          Salesforce Case [5007000000DZqwJ]
          Ken Fyten made changes -
          Fix Version/s 2.0-Beta2 [ 10242 ]
          Assignee Priority P2
          Assignee Ted Goddard [ ted.goddard ]
          Hide
          Ken Fyten added a comment -

          Try it outside the tab to see if it's specific to the tab or not, pls.

          Show
          Ken Fyten added a comment - Try it outside the tab to see if it's specific to the tab or not, pls.
          Ken Fyten made changes -
          Assignee Ted Goddard [ ted.goddard ] Judy Guglielmin [ judy.guglielmin ]
          Ken Fyten made changes -
          Fix Version/s 2.0.0 [ 10230 ]
          Fix Version/s 2.0-Beta2 [ 10242 ]
          Hide
          Arran Mccullough added a comment -

          Initial JIRA description was in regards to the converters not being called. Upon further review of the test case from the forum post it became evident that this issue was an issue with the component option values. When changing the values to the list of SelectItem objects the converters are called without any problems.

          Show
          Arran Mccullough added a comment - Initial JIRA description was in regards to the converters not being called. Upon further review of the test case from the forum post it became evident that this issue was an issue with the component option values. When changing the values to the list of SelectItem objects the converters are called without any problems.
          Arran Mccullough made changes -
          Summary ICEfaces2.0 problems with supporting converters in jsf2.0 Can't send in an array of objects as the values for a selectOneMenu component
          Workaround Description Use a list/array that consists of SelectItem objects.

          For Example:
                  cityList = new ArrayList<SelectItem>();
                  cityList.add(new SelectItem("TORONTO", "TORONTO"));
                  cityList.add(new SelectItem("CALGARY", "CALGARY"));
          Workaround Exists [Yes]
          Description THe example attached and referenced on the forum posting has the converter within a selectOneMenu on an <ice:panelTabset> (compat). Should do the same thing but just with plain jsf (without compat) to see if the issue is with compat or just in general. May also be issue with panelTabSet component. With the JSF <h:selectOneMenu> component, you can use an array of objects for the selectOneMenu options. Using the same set of objects for an <ice:selectOneMenu> does not show the options. For example:

          JSF Component Code:
          <h:selectOneMenu value="#{backingBean.city}" >
               <f:selectItems value="#{backingBean.cities}"/>
          </h:selectOneMenu>

          Backing Bean Code:
          public City[] getCities() {
                  return City.values();
          }

          Testing with ICEfaces 1.8.x and JSF 1.2 showed that the array of objects does not work for both the JSF and ICEfaces components. It looks like something was changed on the JSF component and this has not been changed with the ICEfaces components.
          Security Private [ 10001 ]
          Arran Mccullough made changes -
          Attachment Case9477Example2.war [ 12638 ]
          Hide
          Arran Mccullough added a comment -

          Attached NetBeans test case build for Glassfish V3

          Show
          Arran Mccullough added a comment - Attached NetBeans test case build for Glassfish V3
          Arran Mccullough made changes -
          Affects Version/s 2.0-Beta2 [ 10242 ]
          Ken Fyten made changes -
          Affects [Documentation (User Guide, Ref. Guide, etc.)]
          Assignee Priority P2
          Assignee Judy Guglielmin [ judy.guglielmin ] Adnan Durrani [ adnan.durrani ]
          Ken Fyten made changes -
          Assignee Priority P1
          Hide
          Adnan Durrani added a comment -

          I tried to make this demo work but no luck. I will try to mimic.

          Show
          Adnan Durrani added a comment - I tried to make this demo work but no luck. I will try to mimic.
          Repository Revision Date User Message
          ICEsoft Public SVN Repository #23185 Mon Nov 22 22:27:35 MST 2010 adnan.durrani Fix for ICE-6107 (Can't send in an array of objects as the values for a selectOneMenu component )
          Files Changed
          Commit graph MODIFY /icefaces2/trunk/icefaces/compat/core/src/main/java/com/icesoft/faces/renderkit/dom_html_basic/MenuRenderer.java
          Adnan Durrani made changes -
          Status Open [ 1 ] In Progress [ 3 ]
          Hide
          Adnan Durrani added a comment -

          Enum support added to selectItems. There won't be any need for a Converter.

          Command: Commit
          Modified: D:\work\development\head\svn\ossrepo\icefaces2\trunk\icefaces\compat\core\src\main\java\com\icesoft\faces\renderkit\dom_html_basic\MenuRenderer.java
          Sending content: D:\work\development\head\svn\ossrepo\icefaces2\trunk\icefaces\compat\core\src\main\java\com\icesoft\faces\renderkit\dom_html_basic\MenuRenderer.java
          Completed: At revision: 23185

          Show
          Adnan Durrani added a comment - Enum support added to selectItems. There won't be any need for a Converter. Command: Commit Modified: D:\work\development\head\svn\ossrepo\icefaces2\trunk\icefaces\compat\core\src\main\java\com\icesoft\faces\renderkit\dom_html_basic\MenuRenderer.java Sending content: D:\work\development\head\svn\ossrepo\icefaces2\trunk\icefaces\compat\core\src\main\java\com\icesoft\faces\renderkit\dom_html_basic\MenuRenderer.java Completed: At revision: 23185
          Adnan Durrani made changes -
          Status In Progress [ 3 ] Resolved [ 5 ]
          Resolution Fixed [ 1 ]
          Ken Fyten made changes -
          Status Resolved [ 5 ] Closed [ 6 ]
          Assignee Priority P1
          Wilson Bogado made changes -
          Link This issue blocks ICE-6474 [ ICE-6474 ]

            People

            • Assignee:
              Adnan Durrani
              Reporter:
              Judy Guglielmin
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: