in empire-db-jakarta-faces/src/main/java/org/apache/empire/jakarta/components/ControlTag.java [366:453]
public void encodeBegin(FacesContext context)
throws IOException
{
super.encodeBegin(context);
// init
helper.encodeBegin();
// set InputControl
if (this.control==null)
this.control = helper.getInputControl();
// renderInfo
if (this.renderInfo==null) {
this.renderInfo=helper.getControlRenderInfo();
if (this.renderInfo==null)
this.renderInfo=ControlRenderInfo.getDefault(); // No FormGrid found. Use Default!
}
// Check visiblity
this.controlVisible = helper.isVisible();
// Render
if (this.controlVisible && renderInfo.CONTROL_TAG!=null)
{ // control wrapper tag
ResponseWriter writer = context.getResponseWriter();
writer.startElement(renderInfo.CONTROL_TAG, this);
// render id
helper.writeComponentId(writer, false);
// style class
String controlClass = helper.getTagAttributeStringEx("controlClass", true);
String styleClass = helper.getTagAttributeString(InputControl.CSS_STYLE_CLASS);
String contextClass = helper.getContextStyleClass();
helper.writeStyleClass(writer, TagStyleClass.CONTROL.get(), controlClass, styleClass, contextClass);
}
else if (!this.controlVisible)
{ // render placeholder
renderInfo.renderPlaceholder(context, this);
}
// custom input?
boolean customInput = isCustomInput();
// Create LabelSeparatorComponent
ControlSeparatorComponent labelSepTag = null;
if (true)
{ // Create Label Separator Tag
if (getChildCount() > 0)
labelSepTag = (ControlSeparatorComponent) getChildren().get(0);
if (labelSepTag == null)
{ labelSepTag = new LabelSeparatorComponent();
getChildren().add(labelSepTag);
helper.resetComponentId(labelSepTag);
}
// encode
labelSepTag.setRendered(this.controlVisible);
encodeLabel(context, labelSepTag, customInput);
}
// Create InputSeparatorComponent
ControlSeparatorComponent inputSepTag = null;
if (!customInput)
{ // Create Input Separator Tag
if (getChildCount() > 1)
inputSepTag = (ControlSeparatorComponent) getChildren().get(1);
if (inputSepTag == null)
{ inputSepTag = new InputSeparatorComponent();
getChildren().add(inputSepTag);
helper.resetComponentId(inputSepTag);
}
// encode
inputSepTag.setRendered(this.controlVisible);
encodeInput(context, inputSepTag);
}
else if (getChildCount() > 1)
{ // custom has changed.
getChildren().remove(1);
}
// Encode now
if (labelSepTag!=null)
labelSepTag.encodeAll(context);
if (inputSepTag!=null)
inputSepTag.encodeAll(context);
// done
saveState();
}