Saturday, June 11, 2011

How do I get an LOV / Select One Choice label / Display Attribute in bean?

This is one question that I see in forums all the time. You can find other solution of this issue in oracle forum along with my solution which goes as here:

1. Bind af:selectOneChoice to the bean say. testSOCbindings
2. Bind the f:selectItems to the bean say. testSOCSelectItems
3. Use below code:
Integer i = (Integer) getTestSOCbindings().getValue();
List silist = (List) getTestSOCSelectItems().getValue();

String val = silist.get(i.intValue()).getLabel();

No comments:

Post a Comment