Author: abelevich
Date: 2007-07-27 08:42:18 -0400 (Fri, 27 Jul 2007)
New Revision: 1887
Modified:
trunk/sandbox/ui/message/src/main/java/org/richfaces/component/UIRichMessages.java
trunk/sandbox/ui/message/src/main/java/org/richfaces/renderkit/html/RichMessagesHtmlBaseRenderer.java
Log:
surround renderChildaren with try finally block
Modified:
trunk/sandbox/ui/message/src/main/java/org/richfaces/component/UIRichMessages.java
===================================================================
---
trunk/sandbox/ui/message/src/main/java/org/richfaces/component/UIRichMessages.java 2007-07-27
12:40:50 UTC (rev 1886)
+++
trunk/sandbox/ui/message/src/main/java/org/richfaces/component/UIRichMessages.java 2007-07-27
12:42:18 UTC (rev 1887)
@@ -12,7 +12,7 @@
* @author Anton Belevich
*
*/
-public abstract class UIRichMessages extends UIMessages implements AjaxOutput {
+public abstract class UIRichMessages extends UIMessages implements AjaxOutput{
public static String HEADER_LOCATION_LEFT = "left";
@@ -29,7 +29,7 @@
private boolean isPassed = false;
- public boolean isPassed() {
+ public boolean isPassed(){
return isPassed;
}
@@ -37,19 +37,19 @@
public abstract String getHeaderLocation();
- public boolean isWroteTable() {
+ public boolean isWroteTable(){
return wroteTable;
}
- public void setWroteTable(boolean wroteTable) {
+ public void setWroteTable(boolean wroteTable){
this.wroteTable = wroteTable;
}
- public boolean isIteratorLayout() {
+ public boolean isIteratorLayout(){
return isIteratorLayout;
}
- public void setIteratorLayout(boolean isIteratorLayout) {
+ public void setIteratorLayout(boolean isIteratorLayout){
this.isIteratorLayout = isIteratorLayout;
}
@@ -63,14 +63,15 @@
/* (non-Javadoc)
* @see org.ajax4jsf.component.AjaxOutput#setAjaxRendered(boolean)
*/
- public void setAjaxRendered(boolean ajaxRendered) {
+ public void setAjaxRendered(boolean ajaxRendered){
if(!ajaxRendered){
new IllegalArgumentException();
}
}
- public void decode(FacesContext context) {
+ public void decode(FacesContext context){
isPassed = true;
super.decode(context);
}
+
}
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-27
12:40:50 UTC (rev 1886)
+++
trunk/sandbox/ui/message/src/main/java/org/richfaces/renderkit/html/RichMessagesHtmlBaseRenderer.java 2007-07-27
12:42:18 UTC (rev 1887)
@@ -110,7 +110,7 @@
getUtils().writeAttribute(writer, HTML.cellpadding_ATTRIBUTE, "0");
getUtils().writeAttribute(writer, HTML.cellspacing_ATTRIBUTE, "0");
- renderComponentOuterStyles(uiMessages, context, writer);
+// renderComponentOuterStyles(uiMessages, context, writer);
writer.startElement("tbody", uiMessages);
uiMessages.setWroteTable(true);
@@ -131,7 +131,7 @@
writer.startElement("dl", component);
- renderComponentOuterStyles(uiMessages, context, writer);
+// renderComponentOuterStyles(uiMessages, context, writer);
}
@@ -162,11 +162,17 @@
Map requestMap = context.getExternalContext().getRequestMap();
Object value = requestMap.get(var);
requestMap.put(var, facesMsg);
- renderChildren(context, uiMessages);
- if(value != null){
- requestMap.put(var, value);
- }
+ try {
+ renderChildren(context, uiMessages);
+ } finally {
+
+ if(value != null){
+ requestMap.put(var, value);
+ }
+
+ }
+
}
}
@@ -380,6 +386,8 @@
writer.startElement("table", uiMessages);
getUtils().writeAttribute(writer, HTML.id_ATTRIBUTE,clientId);
+ renderComponentOuterStyles(component, context, writer);
+
writer.startElement("tbody", uiMessages);
if(headerLocation.equals(UIRichMessages.HEADER_LOCATION_BOTTOM)){