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;
}
Aggregations