[ 
https://issues.apache.org/jira/browse/MYFACES-2753?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12887694#action_12887694
 ] 

Jakob Korherr commented on MYFACES-2753:
----------------------------------------

Hi Leo,

Please don't get me wrong, but I am not stupid - I know this stuff ;) - 
however, thanks for this summary for the community!

Really it is not that complicated. There is just no reason why ui:composition 
should use extendClient() and ui:decorate should use pushClient(). The spec 
javadoc actually says that those two are identical: "The decorate tag is 
identical to the composition tag, except that ui:decorate, unlike 
ui:composition, does not disregard all content outside of the tag."

So this would only leave ui:insert (--> the fallback content) for 
extendClient(), but this also does not make sence, if you look at it in more 
detail. Please just take the above example from Martin and debug through it 
(and maybe also read my above comment again) - then you will know what I mean ;)

Isolating the template context would also work, but it would let wrong code 
seem like correct code..

I don't know, Leo. If you look at the code in more detail, you will see it is 
really messy. Frankly I would really like to have this in the release...

Regards,
Jakob

> Trivial multi-level templating does not work if ui:include is used
> ------------------------------------------------------------------
>
>                 Key: MYFACES-2753
>                 URL: https://issues.apache.org/jira/browse/MYFACES-2753
>             Project: MyFaces Core
>          Issue Type: Bug
>          Components: JSR-314
>    Affects Versions: 2.0.2-SNAPSHOT
>         Environment: myfaces core trunk (2.0.2-SNAPSHOT), tomcat 6.0.26
>            Reporter: Martin Kočí
>            Assignee: Jakob Korherr
>         Attachments: MYFACES-2753-tests.patch, MYFACES-2753.patch, 
> MYFACES-2753.tar.gz
>
>
> Following example does not produce any output:
> OuterClient.xhtml
> <ui:decorate
>     template="/templates/OuterTemplate.xhtml"
>     xmlns:ui="http://java.sun.com/jsf/facelets";>
>     <ui:define name="content">
>         <ui:include src="InnerClient.xhtml" />
>     </ui:define>
> </ui:decorate>
> OuterTemplate.xhtml:
> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
> "http://www.w3.org/TR/html4/loose.dtd";>
> <html
>     xmlns="http://www.w3.org/1999/xhtml";
>     xmlns:ui="http://java.sun.com/jsf/facelets";
>     xmlns:f="http://java.sun.com/jsf/core";
>     xmlns:h="http://java.sun.com/jsf/html";>
> <f:view>
>     <h:head>
>         <title>title</title>
>     </h:head>
>     <h:body>
>         <ui:insert name="content" />
>     </h:body>
> </f:view>
> </html>
> InnerClient.xhtml:
> <ui:composition
>     template="/templates/InnerTemplate.xhtml"
>     xmlns="http://www.w3.org/1999/xhtml";
>     xmlns:ui="http://java.sun.com/jsf/facelets";>
>     <ui:define name="content">
>         Do you see me?
>     </ui:define>
> </ui:composition>
> InnerTemplate.xhtml:
> <f:subview
>     xmlns:ui="http://java.sun.com/jsf/facelets";
>     xmlns:f="http://java.sun.com/jsf/core";>
>     <ui:insert name="content" />
> </f:subview>
> But if OutterClient.xhtml looks like:
> <ui:decorate
>     template="/templates/OuterTemplate.xhtml"
>     xmlns:ui="http://java.sun.com/jsf/facelets";>
>     <ui:define name="content">
>         <ui:composition template="/templates/InnerTemplate.xhtml">
>             <ui:define name="content">
>                 Do you see me?
>             </ui:define>
>         </ui:composition>
>     </ui:define>
> </ui:decorate>
> it outputs "Do you see me?" which is expected result in both cases. I think 
> first case should work too - or am I missing something?

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to