backing bean how to get options which are changed sequence by javascript
In page, I change the sequence of options which created by tag <f:selectItems> via javascript,
so in backing bean, I must catch the correct sequence of options.
How to achieve it?
In page I binding selectOneListbox tag with backing bean's UIInput property "subCategoryList". but can't get the correct sequence of options.
<--page-->
<h:selectOneListbox id="childOrgs" value="#{orgDelegate.lsOrg.orgName}" binding="#{orgDelegate.subCategoryList}" actionListener="#{orgDelegate.getOrgsFromClient} >
<f:selectItems id="orgNames" value="#{orgDelegate.orgNames}" />
</h:selectOneListbox>
<--backing bean-->
public class LsOrgDelegate extends BaseDelegate {
private HtmlSelectOneListbox selObj;
private UIInput subCategoryList;
{
subCategoryList = new HtmlSelectOneListbox();
}
public UIInput getSubCategoryList() {
return subCategoryList;
}
public void setSubCategoryList(UIInput subCategoryList) {
this.subCategoryList = subCategoryList;
ArrayList list = new ArrayList();
if (subCategoryList != null){
UISelectItems items = (UISelectItems) subCategoryList.getChildren().get(0);
Iterator iter = items.getChildren().iterator();
while(iter.hasNext()){
UIComponent kid = (UIComponent) iter.next();
if (kid instanceof UISelectItem) {
Object value = ((UISelectItem) kid).getValue();
if (value == null) {
} else if (value instanceof SelectItem) {
list.add(value);
} else {
throw new IllegalArgumentException(Util.getExceptionMessageString(
Util.CONVERSION_ERROR_MESSAGE_ID));
}
}
}
}
if (list != null && !list.isEmpty()){
this.orgNames.clear();
this.orgNames.addAll(list);
}
}
}
How to achieve this?

