I want to show continuous integer values from a certain min value to max value.
Is there any way of looping from min to max on xhtml page and add loop values to selectItems
Currently I am doing as:
<p:selectOneMenu>
<f:selectItems value="#{bean.intValuesFrom25ToMaxValue}" var="myInteger" itemValue="#{myInteger}" itemLabel="#{myInteger}" />
</p:selectOneMenu>
NOTE: There is no problem with current solution, but I have a lot of different select one menus whose values are just a continuous range of integers, so for all of the I have to write getter functions? Thats why I want to create a loop on xhtml page.
You can do this with
I hope it’s correct, I have no chance to try it right now:-)
EDIT
In that case try this
It’s not a perfect solution because you are mixing JSTL with JSF (which sometimes causes problem) but in this case is fine because your loop does not use any dynamic values.