Question

I am unable to populate a select with integers. It seems that String values are populated for numbers from 0 to 15. However 16 is OK.

<h:selectOneMenu value="#{myBean.myIntegerValue}" >
    <c:forEach begin="0" end="15" var="e">
        <f:selectItem itemLabel="#{e}" itemValue="#{e}"/>
    </c:forEach>
    <f:selectItem itemValue="16" itemLabel="16" />

    <f:convertNumber integerOnly="true" />
</h:selectOneMenu> 

(if i select a value between 0-15 I get a validation error: Value is not valid)

Any Ideas? Mojarra 2.2.6, glassfish 4.0.1

Thanks

Was it helpful?

Solution

Removing this tag: <f:convertNumber integerOnly="true" /> should solve the problem.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top