use of com.sun.web.ui.view.html.CCSelectableList in project OpenAM by OpenRock.
the class ActionTiledView method displayMultipleChoiceAction.
private boolean displayMultipleChoiceAction(ActionSchema actionSchema, String childName, int type, int syntax) {
boolean display = false;
RuleOpViewBeanBase parentVB = (RuleOpViewBeanBase) getParentViewBean();
String serviceType = (String) parentVB.propertySheetModel.getValue(RuleOpViewBeanBase.SERVICE_TYPE);
if (type == AMDisplayType.TYPE_MULTIPLE_CHOICE) {
CCSelectableList child = (CCSelectableList) getChild(childName);
child.resetStateData();
CCAddRemoveModel addRemoveModel = (CCAddRemoveModel) model.getModel(childName);
Set defaultValues = parentVB.getValues(addRemoveModel.getSelectedOptionList());
if ((defaultValues == null) || defaultValues.isEmpty()) {
defaultValues = parentVB.getDefaultActionValues(actionSchema);
}
OptionList optList = parentVB.getChoiceValues(serviceType, actionSchema);
int sz = optList.size();
OptionList availList = new OptionList();
for (int i = 0; i < sz; i++) {
Option opt = (Option) optList.get(i);
if (!defaultValues.contains(opt.getValue())) {
availList.add(opt);
}
}
addRemoveModel.setAvailableOptionList(availList);
addRemoveModel.setSelectedOptionList(parentVB.createOptionList(defaultValues));
display = true;
}
return display;
}
Aggregations