Search in sources :

Example 1 with CCTextField

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

the class ReferralOpViewBeanBase method beginChildDisplay.

public boolean beginChildDisplay(ChildDisplayEvent event) {
    super.endDisplay(event);
    boolean display = true;
    String childName = event.getChildName();
    int syntax = Integer.parseInt((String) propertySheetModel.getValue(SYNTAX));
    if ((childName.indexOf(LBL_FILTER) != -1) || (childName.indexOf(BTN_FILTER) != -1) || (childName.indexOf(FILTER) != -1)) {
        display = (syntax == AMDisplayType.SYNTAX_SINGLE_CHOICE) || (syntax == AMDisplayType.SYNTAX_MULTIPLE_CHOICE);
    } else if (childName.indexOf(VALUES_TEXT_VALUE) != -1) {
        display = (syntax == AMDisplayType.SYNTAX_TEXTFIELD);
        Set values = getDefaultValues();
        if ((values != null) && !values.isEmpty()) {
            if (canModify) {
                CCTextField tf = (CCTextField) getChild(childName);
                tf.setValue(values.iterator().next());
            } else {
                CCStaticTextField tf = (CCStaticTextField) getChild(childName);
                tf.setValue(values.iterator().next());
            }
        }
    } else if (childName.indexOf(VALUES_SINGLE_CHOICE_VALUE) != -1) {
        display = (syntax == AMDisplayType.SYNTAX_SINGLE_CHOICE);
        if (display) {
            Set values = getDefaultValues();
            if (canModify) {
                CCSelect child = (CCSelect) getChild(childName);
                setPossibleValues(child);
                if ((values != null) && !values.isEmpty()) {
                    child.setValue(values.iterator().next());
                }
            } else {
                CCStaticTextField tf = (CCStaticTextField) getChild(childName);
                tf.setValue(values.iterator().next());
            }
        }
    } else if (childName.indexOf(VALUES_MULTIPLE_CHOICE_VALUE) != -1) {
        display = (syntax == AMDisplayType.SYNTAX_MULTIPLE_CHOICE);
        if (display) {
            Set values = getDefaultValues();
            if (canModify) {
                CCSelect child = (CCSelect) getChild(childName);
                setPossibleValues(child);
                if ((values != null) && !values.isEmpty()) {
                    child.setValues(values.toArray());
                }
            } else {
                CCStaticTextField tf = (CCStaticTextField) getChild(childName);
                tf.setValue(AMAdminUtils.getString(values, ",", false));
            }
        }
    }
    return display;
}
Also used : Set(java.util.Set) CCTextField(com.sun.web.ui.view.html.CCTextField) CCSelect(com.sun.web.ui.view.html.CCSelect) CCStaticTextField(com.sun.web.ui.view.html.CCStaticTextField)

Aggregations

CCSelect (com.sun.web.ui.view.html.CCSelect)1 CCStaticTextField (com.sun.web.ui.view.html.CCStaticTextField)1 CCTextField (com.sun.web.ui.view.html.CCTextField)1 Set (java.util.Set)1