use of com.sun.web.ui.taglib.html.CCCheckBoxTag in project OpenAM by OpenRock.
the class CCPropertySheetTag method getValueHTML.
@Override
protected String getValueHTML(Node valueNode, String labelId, boolean levelThree) throws JspException, IllegalArgumentException {
if (valueNode == null) {
CCDebug.trace1("Property node missing value element");
return null;
}
String viewName = getAttributeValue(valueNode, "name", "");
String tagclassName = getAttributeValue(valueNode, "tagclass", "com.sun.web.ui.taglib.html.CCStaticTextFieldTag");
View child = null;
if (!tagclassName.equals("com.sun.web.ui.taglib.spacer.CCSpacerTag") && !tagclassName.equals("org.forgerock.openam.console.ui.taglib.spacer.CCSpacerTag")) {
child = containerView.getChild(viewName);
}
CCTagBase tag = getCCTag(tagclassName);
tag.setName(viewName);
if (labelId != null) {
tag.setElementId(labelId);
}
if (tagclassName.equals("com.sun.web.ui.taglib.html.CCCheckBoxTag")) {
CCCheckBoxTag cb = (CCCheckBoxTag) tag;
cb.setStyleLevel(levelThree ? "3" : "2");
cb.setElementId(getNextLabelId());
} else if (tagclassName.equals("com.sun.web.ui.taglib.html.CCRadioButtonTag")) {
CCRadioButtonTag rb = (CCRadioButtonTag) tag;
rb.setStyleLevel(levelThree ? "3" : "2");
rb.setElementId(getNextLabelId());
}
if (valueNode.hasChildNodes()) {
NodeList childNodeList = valueNode.getChildNodes();
BodyContent bodyContent = null;
if (tag instanceof BodyTag) {
bodyContent = new CCBodyContentImpl(new CCJspWriterImpl(null, 100, false));
}
OptionList options = null;
if (child != null && (child instanceof SelectableGroup)) {
options = new OptionList();
}
for (int i = 0; i < childNodeList.getLength(); i++) {
parseValueChildNode(childNodeList.item(i), tag, bodyContent, options);
}
if (bodyContent != null) {
((BodyTag) tag).setBodyContent(bodyContent);
}
if (options != null && options.size() > 0) {
((SelectableGroup) child).setOptions(options);
}
}
if (tag.getBundleID() == null) {
tag.setBundleID(getBundleID());
}
tag.setTabIndex(getTabIndex());
String html = null;
if (fireBeginDisplayEvent(containerView, tag)) {
html = tag.getHTMLString(getParent(), pageContext, child);
}
return fireEndDisplayEvent(containerView, tag, html);
}
Aggregations