Search in sources :

Example 6 with CCSelectableList

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;
}
Also used : CCAddRemoveModel(com.sun.web.ui.model.CCAddRemoveModel) Set(java.util.Set) CCSelectableList(com.sun.web.ui.view.html.CCSelectableList) Option(com.iplanet.jato.view.html.Option) OptionList(com.iplanet.jato.view.html.OptionList)

Aggregations

CCSelectableList (com.sun.web.ui.view.html.CCSelectableList)6 OptionList (com.iplanet.jato.view.html.OptionList)4 Set (java.util.Set)4 Iterator (java.util.Iterator)3 Option (com.iplanet.jato.view.html.Option)2 AMConsoleException (com.sun.identity.console.base.model.AMConsoleException)2 CCEditableList (com.sun.web.ui.view.editablelist.CCEditableList)2 ArrayList (java.util.ArrayList)2 HashMap (java.util.HashMap)2 List (java.util.List)2 Map (java.util.Map)2 EntitiesModel (com.sun.identity.console.idm.model.EntitiesModel)1 PolicyModel (com.sun.identity.console.policy.model.PolicyModel)1 RMRealmModel (com.sun.identity.console.realm.model.RMRealmModel)1 CCAddRemoveModel (com.sun.web.ui.model.CCAddRemoveModel)1 CCCheckBox (com.sun.web.ui.view.html.CCCheckBox)1 CCStaticTextField (com.sun.web.ui.view.html.CCStaticTextField)1 HashSet (java.util.HashSet)1