*
*/
public class HtmlRichMessagesRenderer extends RichMessageBaseRenderer {
protected void doEncodeEnd(ResponseWriter writer, FacesContext context, UIComponent component) throws IOException {
UIRichMessages uiMessages = (UIRichMessages)component;
String layout = null;
Iterator<FacesMessage> messagesIter = uiMessages.getMessages(context);
boolean isDisplayNone = !messagesIter.hasNext();
boolean isWroteTable = false;
layout = (String)uiMessages.getAttributes().get("layout");
if("table".equals(layout)){
writer.startElement("table", uiMessages);
getUtils().writeAttribute(writer,HTML.id_ATTRIBUTE ,uiMessages.getClientId(context));
getUtils().writeAttribute(writer, HTML.cellpadding_ATTRIBUTE, "0");
getUtils().writeAttribute(writer, HTML.cellspacing_ATTRIBUTE, "0");
renderComponentOuterStyles(uiMessages, context, writer, isDisplayNone);
writer.startElement("tbody", uiMessages);
isWroteTable = true;
} else if("list".equals(layout)){
isWroteTable = false;
writer.startElement(HTML.DL_ELEMENT, uiMessages);
getUtils().writeAttribute(writer,HTML.id_ATTRIBUTE ,uiMessages.getClientId(context));
renderComponentOuterStyles(uiMessages, context, writer, isDisplayNone);
} else {
throw new FacesException("unknown messages layout "+layout);
}