• Post Reply Bookmark Topic Watch Topic
  • New Topic

How can we set different result for label and value in f:selectItems?

 
George Liao
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
We can set itemValue and itemLabel differently in f:selectItem
<f:selectItem itemValue="0" itemLabel="cats"/>


How can we set different result for label and value in f:selectItems?
<f:selectItems value="#{selectAnimals}"/> always creates same result for the label and value

Thanks,

George
 
vishwa venkat
Ranch Hand
Posts: 185
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In backend Bean you can declare selectAnimals as a List of SelectItems.

SelectItem item1=new SelectItem();

I guess there are methopds to set lable and value on items.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!