Search in sources :

Example 11 with CCRadioButton

use of com.sun.web.ui.view.html.CCRadioButton in project OpenAM by OpenRock.

the class MAPCreateDeviceViewBean method beginDisplay.

public void beginDisplay(DisplayEvent event) throws ModelControlException {
    super.beginDisplay(event);
    disableButton("button1", true);
    MAPCreateDeviceModel model = (MAPCreateDeviceModel) getModel();
    String profileName = (String) getPageSessionAttribute(MAPClientManagerViewBean.PAGE_SESSION_PROFILE_NAME);
    Set styles = model.getStyleNames(profileName);
    if ((styles != null) && !styles.isEmpty()) {
        CCRadioButton btn = (CCRadioButton) getChild(RADIO_STYLE);
        OptionList styleList = new OptionList();
        for (Iterator iter = styles.iterator(); iter.hasNext(); ) {
            String name = (String) iter.next();
            styleList.add(name, name);
        }
        btn.setOptions(styleList);
        String value = (String) getDisplayFieldValue(RADIO_STYLE);
        if ((value == null) || (value.trim().length() == 0)) {
            setDisplayFieldValue(RADIO_STYLE, (String) styles.iterator().next());
        }
    }
}
Also used : CCRadioButton(com.sun.web.ui.view.html.CCRadioButton) Set(java.util.Set) MAPCreateDeviceModel(com.sun.identity.console.service.model.MAPCreateDeviceModel) Iterator(java.util.Iterator) OptionList(com.iplanet.jato.view.html.OptionList)

Aggregations

CCRadioButton (com.sun.web.ui.view.html.CCRadioButton)11 OptionList (com.iplanet.jato.view.html.OptionList)6 Map (java.util.Map)4 AMPropertySheet (com.sun.identity.console.base.AMPropertySheet)3 AMConsoleException (com.sun.identity.console.base.model.AMConsoleException)3 Iterator (java.util.Iterator)3 Set (java.util.Set)3 View (com.iplanet.jato.view.View)2 SubConfigModel (com.sun.identity.console.service.model.SubConfigModel)2 CCPageTitle (com.sun.web.ui.view.pagetitle.CCPageTitle)2 ViewBean (com.iplanet.jato.view.ViewBean)1 AbstractAuditModel (com.sun.identity.console.audit.model.AbstractAuditModel)1 AMPropertySheetModel (com.sun.identity.console.base.model.AMPropertySheetModel)1 IDRepoModel (com.sun.identity.console.realm.model.IDRepoModel)1 ServicesModel (com.sun.identity.console.realm.model.ServicesModel)1 MAPCreateDeviceModel (com.sun.identity.console.service.model.MAPCreateDeviceModel)1 SubSchemaModel (com.sun.identity.console.service.model.SubSchemaModel)1 ArrayList (java.util.ArrayList)1 HashMap (java.util.HashMap)1 HashSet (java.util.HashSet)1