[
https://jira.jboss.org/jira/browse/JBSEAM-3430?page=com.atlassian.jira.pl...
]
Pete Muir closed JBSEAM-3430.
-----------------------------
Fix Version/s: 2.1.0.CR1
Resolution: Done
Assignee: Pete Muir
Fixed in trunk, please test.
s:selectitems noSelectionLabel broken for java.util.Map
--------------------------------------------------------
Key: JBSEAM-3430
URL:
https://jira.jboss.org/jira/browse/JBSEAM-3430
Project: Seam
Issue Type: Bug
Components: JSF Controls, JSF Integration
Affects Versions: 2.0.2.SP1
Environment: On plain Tomcat 6.0.18, with JDK 1.6.u7
Reporter: Francisco Jose Peredo Noguez
Assignee: Pete Muir
Fix For: 2.1.0.CR1
This works fine, it uses a using a List<Map> as source in #{controller.sourceList},
and it should put the selected map in #{controller.mapProperty['key']} (BTW it
seems it is putting the toString() fo the map in #{controller.mapProperty['key']}
instead of the Map):
<h:selectOneMenu name="selectName"
value="#{controller.mapProperty['key']}" >
<s:selectItems value="#{controller.sourceList}" var="item"
label="#{item['label']}"/>
</h:selectOneMenu>
This crashes (the difference? I added a noSelectionLabel):
<h:selectOneMenu name="selectName"
value="#{controller.mapProperty['key']}" >
<s:selectItems noSelectionLabel="Please select item"
value="#{controller.sourceList}" var="item"
label="#{item['label']}"/>
</h:selectOneMenu>
Stack trace:
java.lang.NullPointerException: Argument Error: Parameter targetClass is null
at
com.sun.faces.application.ApplicationImpl.createConverter(ApplicationImpl.java:740)
at org.jboss.seam.jsf.SeamApplication.createConverter(SeamApplication.java:126)
at
org.jboss.seam.ui.converter.ConverterChain.<init>(ConverterChain.java:88)
at
org.jboss.seam.ui.component.UISelectItems.noSelectionLabel(UISelectItems.java:225)
at org.jboss.seam.ui.component.UISelectItems.getValue(UISelectItems.java:149)
at
com.sun.faces.renderkit.RenderKitUtils.getSelectItems(RenderKitUtils.java:323)
at
com.sun.faces.renderkit.html_basic.MenuRenderer.getOptionNumber(MenuRenderer.java:675)
at
com.sun.faces.renderkit.html_basic.MenuRenderer.renderSelect(MenuRenderer.java:793)
at
com.sun.faces.renderkit.html_basic.MenuRenderer.encodeEnd(MenuRenderer.java:335)
at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:836)
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:896)
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:892)
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:892)
at com.sun.facelets.FaceletViewHandler.renderView(FaceletViewHandler.java:592)
at
org.ajax4jsf.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:108)
at org.ajax4jsf.application.AjaxViewHandler.renderView(AjaxViewHandler.java:216)
at
com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:106)
at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:251)
at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:144)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:245)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at
org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:83)
at org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:85)
at
org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:64)
at
org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
at org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:45)
at
org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:141)
at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:281)
at org.jboss.seam.web.Ajax4jsfFilter.doFilter(Ajax4jsfFilter.java:60)
at
org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
at org.jboss.seam.web.LoggingFilter.doFilter(LoggingFilter.java:58)
at
org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
at org.jboss.seam.debug.hot.HotDeployFilter.doFilter(HotDeployFilter.java:68)
at
org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
at org.jboss.seam.servlet.SeamFilter.doFilter(SeamFilter.java:158)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:433)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:845)
at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
at java.lang.Thread.run(Thread.java:619)
I think that the problem is that it can not determine the right type for the
#{controller.mapProperty['key']} expression since it an entry in a java.util.Map
instead of a property in a bean.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira