}
@Override
protected void doEncodeChildren(ResponseWriter writer, FacesContext context, UIComponent component) throws IOException
{
UIDecorate decorate = (UIDecorate) component;
boolean hasMessage = decorate.hasMessage();
UIComponent beforeDecoration = decorate.getDecoration("beforeField");
UIComponent beforeInvalidDecoration = decorate.getDecoration("beforeInvalidField");
if (beforeDecoration != null && !hasMessage)
{
beforeDecoration.setParent(decorate);
renderChild(context, beforeDecoration);
}
if (beforeInvalidDecoration != null && hasMessage)
{
beforeInvalidDecoration.setParent(decorate);
renderChild(context, beforeInvalidDecoration);
}
renderChildren(context, decorate);
UIComponent afterDecoration = decorate.getDecoration("afterField");
UIComponent afterInvalidDecoration = decorate.getDecoration("afterInvalidField");
if (afterDecoration != null && !hasMessage)
{
afterDecoration.setParent(decorate);
renderChild(context, afterDecoration);
}