[seam-issues] [JBoss JIRA] Commented: (JBSEAM-4654) s:selectItems noSelectionLabel does not generate option value
Martin Filip (JIRA)
jira-events at lists.jboss.org
Mon Jun 21 06:37:46 EDT 2010
[ https://jira.jboss.org/browse/JBSEAM-4654?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12536523#action_12536523 ]
Martin Filip commented on JBSEAM-4654:
--------------------------------------
I'm experiencing the same problems as you've described here.
After few hours of experiments I've found, that this problem is related to <ui:debug />.
I have two files: home.xhtml and home2.xhtml in same project, should be same except ui:debug:
home.xhtml:
<body>
<h:selectOneMenu value="#{personHome.instance.continent}" required="true" id="continent">
<s:selectItems value="#{continents.resultList}" var="continent" label="#{continent.name}" noSelectionLabel="Please Select..."/>
<s:convertEntity />
</h:selectOneMenu>
</body>
this one does not generate option value
home2.xhtml:
<body>
<ui:debug id="debug" />
<h:selectOneMenu value="#{personHome.instance.continent}" required="true" id="continent">
<s:selectItems value="#{continents.resultList}" var="continent" label="#{continent.name}" noSelectionLabel="Please Select..."/>
<s:convertEntity />
</h:selectOneMenu>
</body>
this one works correct. Except there is present all stuff, which generates ui:debug.
> s:selectItems noSelectionLabel does not generate option value
> -------------------------------------------------------------
>
> Key: JBSEAM-4654
> URL: https://jira.jboss.org/browse/JBSEAM-4654
> Project: Seam
> Issue Type: Bug
> Components: Core
> Affects Versions: 2.2.1.CR1
> Environment: JBoss 6 M3
> Reporter: Andrew Wheeler
>
> When a selectOneMenu has no items other than the no selection option it does not render the option value as org.jboss.seam.ui.NoSelectionConverter.noSelectionValue. In this case the there are no values in person.images.
> <h:selectOneMenu id="portrait" value="#{person.portrait}">
> <s:selectItems value="#{person.images}" var="i" label="#{i.annotation}" hideNoSelectionLabel="false" noSelectionLabel="Select a portrait..."/>
> <s:convertEntity/>
> </h:selectOneMenu>
> This renders:
> <select id="person:portraitDecoration:portrait" name="person:portraitDecoration:portrait" size="1"> <option selected="selected">Select a portrait...</option>
> </select>
> The result is that any form submit causes a java.lang.NumberFormatException with message: "For input string: "Select a portrait...""
> I have debugged a little and I can see that the converter is not firing when rendering the page. It does however fire for other selectOneMenu items on the page that have one or more items.
> A similar and perhaps related issue is referenced in the JBoss Forum.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the seam-issues
mailing list