Loading...

Getting the Value from SelectOneChoice List - Not Index

One of the Issue I found when I use af:selectOneChoice component that when I want to get the selected value from one of the selectOneChoice attribute from backingbean I found the return value is the index of selected value not the value. (Using HR Schema)
assume we have an EmployeesView which has a DepartmentId (as a lookup to DepartmentView) and want to get the the value of selected Department. To solve this problem do this :

Select-One-Choice

 BindingContainer bindings =BindingContext.getCurrent().getCurrentBindingsEntry();
JUCtrlListBinding listBinding =(JUCtrlListBinding)bindings.get("DepartmentId");
Row selectedValue = (Row) listBinding.getSelectedValue();
System.out.println(selectedValue.getAttribute("DepartmentId"));

BPM-SelectOneChoice

Where:

- DepartmentId the selectOneChoice Attribute
which you want to get its value.

- selectedValue is the row of the lookup attribute (In this case will be the row of the selected department).
VirtualNuggets 7438971605825542590

Post a Comment

emo-but-icon

Home item

Popular Posts

Random Posts

Flickr Photo