myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lof...@apache.org
Subject [myfaces-tobago] 02/04: TOBAGO-1952: component resource for "body" is not rendered
Date Wed, 02 Jan 2019 09:53:39 GMT
This is an automated email from the ASF dual-hosted git repository.

lofwyr pushed a commit to branch tobago-4.x
in repository https://gitbox.apache.org/repos/asf/myfaces-tobago.git

commit 555f05fa8c8cd313cc03f020c50a74689dd3460b
Author: Udo Schnurpfeil <lofwyr@apache.org>
AuthorDate: Mon Nov 12 20:25:52 2018 +0100

    TOBAGO-1952: component resource for "body" is not rendered
    
    (cherry picked from commit 38ce974203134029c04b8d64e806f0f879981f21)
---
 .../myfaces/tobago/internal/renderkit/renderer/PageRenderer.java   | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/PageRenderer.java
b/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/PageRenderer.java
index da3b55e..a31df82 100644
--- a/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/PageRenderer.java
+++ b/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/PageRenderer.java
@@ -83,6 +83,7 @@ public class PageRenderer extends RendererBase {
 
   private static final String LAST_FOCUS_ID = "lastFocusId";
   private static final String HEAD_TARGET = "head";
+  private static final String BODY_TARGET = "body";
 
   @Override
   public void decode(final FacesContext facesContext, final UIComponent component) {
@@ -330,6 +331,7 @@ public class PageRenderer extends RendererBase {
   public void encodeEnd(final FacesContext facesContext, final UIComponent component) throws
IOException {
 
     final UIPage page = (UIPage) component;
+    final UIViewRoot viewRoot = facesContext.getViewRoot();
     final TobagoResponseWriter writer = getResponseWriter(facesContext);
     final String clientId = page.getClientId(facesContext);
     final Application application = facesContext.getApplication();
@@ -361,6 +363,11 @@ public class PageRenderer extends RendererBase {
     writer.endElement(HtmlElements.NOSCRIPT);
     writer.endElement(HtmlElements.DIV);
 
+    final List<UIComponent> bodyResources = viewRoot.getComponentResources(facesContext,
BODY_TARGET);
+    for (final UIComponent bodyResource : bodyResources) {
+      bodyResource.encodeAll(facesContext);
+    }
+
     if (!portlet) {
       writer.endElement(HtmlElements.BODY);
       writer.endElement(HtmlElements.HTML);


Mime
View raw message