Details
-
Type: Improvement
-
Status: Closed
-
Priority: Major
-
Resolution: Fixed
-
Affects Version/s: 2.0.0
-
Fix Version/s: 2.0.1
-
Component/s: ICE-Components
-
Labels:None
-
Environment:jsf2.0, ICEfaces-2.0
-
ICEsoft Forum Reference:
-
Affects:Documentation (User Guide, Ref. Guide, etc.)
-
Workaround Exists:Yes
-
Workaround Description:HideUse 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"));ShowUse 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
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.
-
Hide
- ICE-6474.war
- 6.31 MB
- Wilson Bogado
-
- META-INF/MANIFEST.MF 0.1 kB
- META-INF/context.xml 0.1 kB
- WEB-INF/classes/ice6474/City.class 1 kB
- WEB-INF/classes/ice6474/TestBean.class 1 kB
- WEB-INF/lib/commons-beanutils.jar 223 kB
- WEB-INF/lib/commons-collections.jar 554 kB
- WEB-INF/lib/commons-digester.jar 137 kB
- WEB-INF/lib/commons-logging.jar 30 kB
- WEB-INF/lib/icefaces-compat.jar 2.59 MB
- WEB-INF/lib/icefaces.jar 183 kB
- WEB-INF/lib/jsf-api.jar 580 kB
- WEB-INF/lib/jsf-impl.jar 1.74 MB
- WEB-INF/lib/jxl.jar 689 kB
- WEB-INF/.../krysalis-jCharts-1.0.0-alpha-1.jar 148 kB
- WEB-INF/web.xml 2 kB
- index.xhtml 2 kB
-
Hide
- ICE-6474.zip
- 17 kB
- Wilson Bogado
-
- ICE-6474/build.xml 3 kB
- ICE-6474/nbproject/ant-deploy.xml 2 kB
- ICE-6474/nbproject/build-impl.xml 53 kB
- ICE-6474/nbproject/genfiles.properties 0.5 kB
- ICE-6474/nbproject/.../private.properties 0.4 kB
- ICE-6474/nbproject/project.properties 3 kB
- ICE-6474/nbproject/project.xml 1 kB
- ICE-6474/src/conf/MANIFEST.MF 0.0 kB
- ICE-6474/src/java/ice6474/City.java 0.7 kB
- ICE-6474/src/java/ice6474/TestBean.java 0.7 kB
- ICE-6474/web/index.xhtml 2 kB
- ICE-6474/web/META-INF/context.xml 0.1 kB
- ICE-6474/web/WEB-INF/web.xml 2 kB
Issue Links
- depends on
-
ICE-6107 Can't send in an array of objects as the values for a selectOneMenu component
- Closed
Activity
- All
- Comments
- History
- Activity
- Remote Attachments
- Subversion
Issue ICE-6107 does not seem to be resolved.
I have tested ICE-6107 with enum and its working fine.
<ice:selectOneMenu partialSubmit="true" value="#
{selectionTags.city}"><f:selectItems
value="#{selectionTags.cities}"/>
</ice:selectOneMenu>
<h:outputText value="Selected City : #{selectionTags.city}
" />
--------------
- Bean
private City city;
public City getCity()
{ return city; }public void setCity(City city)
{ this.city = city; }public City[] getCities()
{ return City.values(); }public enum City
{ TORONTO, CALGARY; }Can you please attach a working .war including source code?
I just realized that the ICEfaces selectOneMenu behaves differently when the items are in a List than when they are in an array. In the attached example I try to demonstrate what I have found out. I hope this helps you figure out the problem.
Thanks Wilson. This test app helped a lot. I am close to fix this bug.
Fixed.
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: 23852
The fix for this issue has created the regression recorded in ICE-6514. The explanation for the fix is found here: http://jira.icefaces.org/browse/ICE-6514?focusedCommentId=32808&page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#action_32808
The following example still does not work:
<ice:selectOneMenu value="#
{testBean.itemCode}">
{testBean.itemList}<f:selectItems value="#
" var="item" itemValue="#
{item.code}" itemLabel="#
{item.name}"/>
</ice:selectOneMenu>
Where:
itemCode is an Integer
itemList is a List<Item>
item.code is an Integer
item.nam is a String
When running this example, ICEFaces seems to try to assign item.toString() to itemCode which results in a conversion error.
h:selectOneMenu works as expected.