This blog is about building a select once choice using an ArrayList.
In few scenarios , we have to show the list of values returned by a web service , this solution can be used for such cases.
1)Create a bean with an arraylist and code to populate this arraylist.
2)By default , While dropping a select one choice f:selectItems is created and it's value points to ListBinding.
For our use case , we will replace f:selectItems with af:forEach and map it's value to appropriate arraylist.
Perhaps, giving an example of a scenario where arraylist would be required to be used as a source of selectOneChoice will be useful.
ReplyDeleteHow would I achieve ID - Meaning feature, i would want to store ID value in DB and display Meaning in list?
In few scenarios , we have to show the list of values returned by a web service , this solution can be used for such cases.
Delete"How would I achieve ID - Meaning feature, i would want to store ID value in DB and display Meaning in list?"
This will be achieved by using the Label and value properties of af:selectItem appropriately.