} else if (bIsOptional) {
HtmlPanelGroup captionPanel = new HtmlPanelGroup();
captionPanel.setStyleClass("optionalSectionHeader");
HtmlPanelGrid headerTable = new HtmlPanelGrid();
headerTable.setColumns(2);
headerTable.setStyleClass("optionalSectionHeader");
headerTable.setSummary(msgBroker.retrieveMessage("catalog.general.designOnly"));
HtmlSelectBooleanCheckbox checkBox = new HtmlSelectBooleanCheckbox();
checkBox.setId(sCheckboxId);
checkBox.setSelected(getOpen());
checkBox.setOnclick(sbOnclick.toString());
headerTable.getChildren().add(checkBox);
HtmlOutputLabel caption = new HtmlOutputLabel();
// even label has to have unique id (for GlassFish)
caption.setId(sCheckboxId+"label");
caption.setFor(sCheckboxId);
caption.setValue(sCaption);
caption.setStyleClass("sectionCaption");
headerTable.getChildren().add(caption);
panel.getChildren().add(headerTable);
} else {
HtmlPanelGrid headerTable = new HtmlPanelGrid();
headerTable.setColumns(3);
headerTable.setStyleClass("mandatorySectionHeader");
headerTable.setSummary(msgBroker.retrieveMessage("catalog.general.designOnly"));
headerTable.setOnclick(sbOnclick.toString());
HtmlSelectBooleanCheckbox checkBox = new HtmlSelectBooleanCheckbox();
checkBox.setId(sCheckboxId);
checkBox.setSelected(getOpen());
//checkBox.setOnclick(sbOnclick.toString());
checkBox.setStyle("display:none;");
headerTable.getChildren().add(checkBox);
HtmlGraphicImage img = new HtmlGraphicImage();
img.setId(sImgId);
setGraphicUrl(img);
headerTable.getChildren().add(img);
HtmlOutputText caption = new HtmlOutputText();
caption.setValue(sCaption);
caption.setStyleClass("sectionCaption");
headerTable.getChildren().add(caption);
if (getLabel() != null) {
panel.getChildren().add(headerTable);
} else {
panel.setStyleClass("");
}
}
// make the section body
boolean bContainerOnly = (getLabel() == null);
String sBodyClass = "sectionBody";
if (bContainerOnly) sBodyClass= "";
HtmlPanelGrid sectionBody = new HtmlPanelGrid();
sectionBody.setId(sBodyId);
sectionBody.setStyleClass(sBodyClass);
setBodyDisplay(sectionBody);
panel.getChildren().add(sectionBody);
// make the table to hold section parameters, add all parameters
HtmlPanelGrid parametersTable = new HtmlPanelGrid();
parametersTable.setId(sParamsId);
parametersTable.setColumns(2);
parametersTable.setStyleClass("parameters");
parametersTable.setColumnClasses("parameterLabel,parameterInput");
parametersTable.setSummary(msgBroker.retrieveMessage("catalog.general.designOnly"));
for (Parameter parameter: getParameters().values()) {
if (parameter.getVisible()) {
UIComponent cmpLabel = null;
if (parameter.getLabel() != null) {
cmpLabel = parameter.getLabel().makeEditorLabel(context,this,parameter);
}
if (cmpLabel == null) cmpLabel = new HtmlOutputText();
parametersTable.getChildren().add(cmpLabel);
if (parameter.getInput() != null) {
UIComponent cmp = parameter.getInput().makeInputComponent(context,this,parameter);
if (cmp != null) parametersTable.getChildren().add(cmp);
}
} else {
// non-visible hidden text
if ((parameter.getInput() != null) && (parameter.getInput() instanceof InputText)) {
HtmlInputHidden cmpLabel = new HtmlInputHidden();
cmpLabel.setId(parameter.getInput().getFacesId()+"-plcHldr");
HtmlInputHidden cmp = new HtmlInputHidden();
cmp.setId(parameter.getInput().getFacesId());
parameter.getInput().setComponentValue(context,cmp,parameter);
parametersTable.getChildren().add(cmpLabel);
parametersTable.getChildren().add(cmp);
}
}
}
if (parametersTable.getChildCount() > 0) {
sectionBody.getChildren().add(parametersTable);
}
// append all sub-sections
for (Section section: getSections().values()) {