This is how proper af:selectOneChoice definition should look like. Array of items is being rendered in the choice list through f:selectItems tag:
Value property for f:selectItems can be entered manually or through the wizard, when creating af:selectOneChoice - this should point to the custom method, where array of SelectItem objects is constructed:
Custom method could read data from any source and construct array of SelectItem objects. This is the input for f:selectItems tag, it knows how to render a list of choice list items out of it:
This is how it looks on runtime - choice list is working fine, no need to use af:forEach:
Download sample application - CustomSelectListApp.zip.
1 comment:
Hi Andrejus,
Thanks for the info. Actually I need to implement same thing for filter table dropdownlist. How can I achieve this?.
UseCase: when a dropdown is displayed its having multiple duplicated records I want to remove those from that list. but here the list is coming from #{vs.filterCriteria.ViewAttr1}. How can we create a list from these values.
Best Regards,
Raju Chetri
Post a Comment