I would like to add a child component while inside of the encodeBegin
public void encodeBegin(FacesContext context,
UIComponent component)
throws IOException {
XspInputText xip = new XspInputText();
ViewPickList vplComponent = (ViewPickList) component;
ResponseWriter writer = context.getResponseWriter();
String viewName = vplComponent.getViewName();
if (StringUtil.isNotEmpty(viewName)) {
xip.setId(vplComponent.getId() + "_InputText");
xip.setValue("Value");
vplComponent.getChildren().add(xip);
super.encodeBegin(context, vplComponent);
}
This doesn’t appear to work, but I am trying to add the child component inside and have it render. Can anyone suggest a better way of doing this?
You should call you newly added components
encodeBeginandencodeEndmethods to render them too.Try this:
Also take a look at This link.
Please give me feed back if it works or not!