Author: abelevich
Date: 2007-07-25 10:12:08 -0400 (Wed, 25 Jul 2007)
New Revision: 1844
Modified:
trunk/sandbox/ui/message/src/main/java/org/richfaces/renderkit/html/RichMessageHtmlBaseRenderer.java
trunk/sandbox/ui/message/src/main/java/org/richfaces/renderkit/html/RichMessagesHtmlBaseRenderer.java
Log:
fix first rendering
Modified:
trunk/sandbox/ui/message/src/main/java/org/richfaces/renderkit/html/RichMessageHtmlBaseRenderer.java
===================================================================
---
trunk/sandbox/ui/message/src/main/java/org/richfaces/renderkit/html/RichMessageHtmlBaseRenderer.java 2007-07-25
14:05:40 UTC (rev 1843)
+++
trunk/sandbox/ui/message/src/main/java/org/richfaces/renderkit/html/RichMessageHtmlBaseRenderer.java 2007-07-25
14:12:08 UTC (rev 1844)
@@ -82,7 +82,9 @@
}else{
msgIter = getMessageIterator(context, forClientId, msgComponent);
-
+ writer.startElement(HTML.SPAN_ELEM, msgComponent);
+ getUtils().writeAttribute(writer, HTML.id_ATTRIBUTE,
msgComponent.getClientId(context));
+
if(!msgIter.hasNext() && msgComponent.isPassed()){
encodingUIContent(msgComponent, context, null);
@@ -93,6 +95,8 @@
encodingUIContent(msgComponent, context, message);
}
+
+ writer.endElement(HTML.SPAN_ELEM);
}
}
@@ -100,14 +104,11 @@
ResponseWriter writer = context.getResponseWriter();
- writer.startElement(HTML.SPAN_ELEM, uiMsg);
- getUtils().writeAttribute(writer, HTML.id_ATTRIBUTE, uiMsg.getClientId(context));
-
outerStyles(uiMsg, context, writer, facesMsg);
renderMarkerFacet(uiMsg,context, writer,facesMsg);
renderLabel(uiMsg, context, writer, facesMsg);
- writer.endElement(HTML.SPAN_ELEM);
+
}
public void renderOuterStyles(UIComponent component, FacesContext context,
ResponseWriter writer,String outerStyle, String outerClass) throws IOException{
Modified:
trunk/sandbox/ui/message/src/main/java/org/richfaces/renderkit/html/RichMessagesHtmlBaseRenderer.java
===================================================================
---
trunk/sandbox/ui/message/src/main/java/org/richfaces/renderkit/html/RichMessagesHtmlBaseRenderer.java 2007-07-25
14:05:40 UTC (rev 1843)
+++
trunk/sandbox/ui/message/src/main/java/org/richfaces/renderkit/html/RichMessagesHtmlBaseRenderer.java 2007-07-25
14:12:08 UTC (rev 1844)
@@ -114,11 +114,13 @@
throw e;
}
+ writer.startElement(HTML.SPAN_ELEM, component);
+ getUtils().writeAttribute(writer, HTML.id_ATTRIBUTE,
uiMessages.getClientId(context));
uiMessages.setIteratorLayout(true);
}else if((layout != null) && (layout.equals("list"))){
- writer.startElement("ul", component);
+ writer.startElement("dl", component);
getUtils().writeAttribute(writer, HTML.id_ATTRIBUTE,
uiMessages.getClientId(context));
renderComponentOuterStyles(uiMessages, context, writer);
@@ -133,7 +135,7 @@
if(uiMessages.isWroteTable()){
writer.startElement(HTML.TR_ELEMENT, component);
}else{
- writer.startElement("li", component);
+ writer.startElement("dt", component);
}
outerStyles(component, context, writer, facesMsg);
@@ -143,24 +145,29 @@
if(uiMessages.isWroteTable()){
writer.endElement(HTML.TR_ELEMENT);
}else{
- writer.endElement("li");
+ writer.endElement("dt");
}
-
- if(uiMessages.isWroteTable()){
- writer.endElement("tbody");
- writer.endElement("table");
- }else{
- writer.endElement("ul");
- }
-
+
}else{
Map requestMap = context.getExternalContext().getRequestMap();
requestMap.put(var, facesMsg);
-
+ renderChildren(context, uiMessages);
+
}
-
+
}
+
+ if(!uiMessages.isIteratorLayout()){
+ if(uiMessages.isWroteTable()){
+ writer.endElement("tbody");
+ writer.endElement("table");
+ }else{
+ writer.endElement("dl");
+ }
+ }else{
+ writer.endElement(HTML.SPAN_ELEM);
+ }
}