Multi
Select Feature in OAF:
·
We can use OADefaultListBean, which will allow enabling the multi select
feature in list box without refreshing the page or using firePartial Action for
each selection.
·
Below is the sample code to set the multi select list box in page in
Process Request:
OADefaultListBean list =(OADefaultListBean)createWebBean(pageContext,OAWebBeanConstants.DEFAULT_LIST_BEAN,null,
"multiselect1");
list.setListViewObjectDefinitionName("supprdapr.oracle.apps.po.supprdaproval.server.TestingVO");
list.setListValueAttribute("Meaning");
list.setMultiple(true); // This will allow
multi select feature in List
list.setName("MultiList");
OAMessageLayoutBean listBoxLayout = (OAMessageLayoutBean)webBean.findChildRecursive("ListBoxLayout");
listBoxLayout.addIndexedChild(list);
·
Below is the code for retrieving the selected values from Multi
select List in Process Form Request:
OADefaultListBean list =(OADefaultListBean)webBean.findIndexedChildRecursive("multiselect1");
String
name = list.getName();
String[]
selectedValues = pageContext.getParameterValues(name);
for(int
i=0;i<selectedValues.length;i++) {
System.out.println("The
value"+i+" is:"+selectedValues[i]);
}
