use of com.sun.web.ui.view.html.CCRadioButton in project OpenAM by OpenRock.
the class NewAuthInstanceViewBean method createChild.
protected View createChild(String name) {
View view = null;
if (name.equals(PGTITLE_TWO_BTNS)) {
view = new CCPageTitle(this, ptModel, name);
} else if (name.equals(PROPERTY_ATTRIBUTE)) {
view = new AMPropertySheet(this, propertySheetModel, name);
} else if (propertySheetModel.isChildSupported(name)) {
view = propertySheetModel.createChild(this, name, getModel());
if (name.equals(INSTANCE_TYPE)) {
//set the available options for the radio button
CCRadioButton radio = (CCRadioButton) view;
radio.setOptions(createAuthTypeOptionList());
}
} else if (ptModel.isChildSupported(name)) {
view = ptModel.createChild(this, name);
} else {
view = super.createChild(name);
}
return view;
}
use of com.sun.web.ui.view.html.CCRadioButton in project OpenAM by OpenRock.
the class AbstractEventHandlerSelectViewBean method beginDisplay.
@Override
public void beginDisplay(DisplayEvent event) throws ModelControlException {
super.beginDisplay(event);
try {
AbstractAuditModel model = (AbstractAuditModel) getModel();
Set<String> auditHandlerTypes = model.getEventHandlerTypeNames();
OptionList optionList = new OptionList();
for (String type : auditHandlerTypes) {
optionList.add(type, type);
}
CCRadioButton rb = (CCRadioButton) getChild(RB_EVENT_HANDLER);
rb.setOptions(optionList);
rb.setValue(optionList.getValue(0));
} catch (AMConsoleException e) {
setInlineAlertMessage(TYPE_ERROR, ERROR_MESSAGE, e.getMessage());
}
}
use of com.sun.web.ui.view.html.CCRadioButton in project OpenAM by OpenRock.
the class SubSchemaTypeSelectViewBean method beginDisplay.
public void beginDisplay(DisplayEvent event) throws ModelControlException {
super.beginDisplay(event);
SubConfigModel model = (SubConfigModel) getModel();
Map createables = model.getCreateableSubSchemaNames();
CCRadioButton rb = (CCRadioButton) getChild(RB_SUBCONFIG);
OptionList optList = AMFormatUtils.getSortedOptionList(createables, model.getUserLocale());
rb.setOptions(optList);
String val = (String) rb.getValue();
if ((val == null) || (val.length() == 0)) {
rb.setValue(optList.getValue(0));
}
}
use of com.sun.web.ui.view.html.CCRadioButton in project OpenAM by OpenRock.
the class AMPropertySheet method init.
public void init() {
ViewBean parent = getParentViewBean();
AMPropertySheetModel model = (AMPropertySheetModel) getModel();
Map radioComponents = model.getRadioDefaultValues();
if ((radioComponents != null) && !radioComponents.isEmpty()) {
for (Iterator i = radioComponents.keySet().iterator(); i.hasNext(); ) {
String name = (String) i.next();
CCRadioButton rb = (CCRadioButton) parent.getChild(name);
Object value = rb.getValue();
if (value == null) {
rb.setValue(radioComponents.get(name));
}
}
}
}
use of com.sun.web.ui.view.html.CCRadioButton in project OpenAM by OpenRock.
the class ActionTiledView method displayRadioAction.
private boolean displayRadioAction(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_SINGLE) && (syntax == AMDisplayType.SYNTAX_RADIO)) {
CCRadioButton rb = (CCRadioButton) getChild(childName);
OptionList optList = parentVB.getChoiceValues(serviceType, actionSchema);
rb.setOptions(optList);
if ((optList != null) && (optList.size() > 0)) {
Set set = parentVB.isSubmitCycle() ? parentVB.getCurrentActionValues(actionSchema) : parentVB.getDefaultActionValues(actionSchema);
String value = ((set == null) || set.isEmpty()) ? optList.getValue(0) : (String) set.iterator().next();
rb.setValue(value);
display = true;
}
}
return display;
}
Aggregations