How can I do something similar the below in Facelets?
for(int i=0; i<=80; i++){
<f:selectItem itemLabel=i itemValue=i />
}
I have combined both Java and Facelets code in my above code, but I want something like this to work in Facelets. I need the itemLabel and itemValue to be incremented, when the page is loaded. I need to display all values from 1 to 80 as dropdown options.
Is it possible to do so, or is there any other method to achieve the same?
Why don’t you use
Where
someListis a List of Objects…Also , you should take a look at OmniFaces Showcase – Arrays , There are several examples you might find relevant
otherwise you can do it with
c:forEachwith<f:selectItemas proposed by @AurA