Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

insertFacet to another Composite-Component

843844Apr 6 2010 — edited Apr 7 2010
Hi!

My setup:
Netbeans 6.8 + Glassfish v3 + JSF 2.0.2 (also tried 2.0.3 Snapshot of today)

I have following 3 pages:

index.xhtml
<html ...
      xmlns:cs="http://java.sun.com/jsf/composite/component">
    <h:head>
    </h:head>
    <h:body>

                <cs:comp1>

                    <f:facet name="header">
                        HEADER
                    </f:facet>

                </cs:comp1>

    </h:body>
</html>
comp1.xhtml
<html ...
      xmlns:cs="http://java.sun.com/jsf/composite/component">
    <h:head>
    </h:head>

    <h:body>
        <cc:interface>
            <cc:facet name="header" />
        </cc:interface>

        <cc:implementation>

            <cs:comp2>
                <cc:insertFacet name="header" />
            </cs:comp2>

        </cc:implementation>
    </h:body>
</html>
comp2.xhtml
<html ...
      xmlns:cs="http://java.sun.com/jsf/composite/component">
    <h:head>
    </h:head>

    <h:body>
        <cc:interface>
            <cc:facet name="header" />
        </cc:interface>

        <cc:implementation>

            <cc:renderFacet name="header" />

        </cc:implementation>
    </h:body>
</html>
In words, I want to pass a facet through a composite component, however it doesn't work. The text HEADER won't display...

When I change comp1.xhtml to following:
            <h:dataTable>
                <cc:insertFacet name="header" />
            </h:dataTable>
it works. The text HEADER will display.

So what I'm doing wrong? Why my composite-component doesn't receive and display the facet and a jsf-standard-component does? JSF Bug??

Btw.: <cc:insertChildren /> alone doesn't fit my requirements, I need facets.

Thanks in advance,
Schober Markus
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 5 2010
Added on Apr 6 2010
1 comment
684 views