webtier@glassfish.java.net

JSF 2.0 Composite components facet problem

From: <forums_at_java.net>
Date: Wed, 17 Nov 2010 05:56:54 -0800

Hi, I'm having some problems with passing a facet from one composite
component to another. I have one page with a facet for a composite component,
this compoiste component passes the facet along to another composite
component. I can't get this to work. This don't seem to be a problem if the
second component is a custom component.

Here's an example:

This page declare uses the composite component facletsProblemCC with a facet.

/<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.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:scomp="http://www.skd.no/jsf/composite"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:scust="http://www.skd.no/jsf/custom">
<body>
<ui:component>
    <h:form id="facletsProblem">
    <h:outputText value="This is where the text should
display:"></h:outputText>
        <scomp:facletsProblemCC>
            <f:facet name="facet">
                <h:outputText value="Wow, it works!"/>
            </f:facet>
        </scomp:facletsProblemCC>
    </h:form>
</ui:component>
</body>
</html>/

This is the composite component that's passing along the facet to component
facletsProblemCC2.

/<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
    xmlns:cc="http://java.sun.com/jsf/composite"
    xmlns:scomp="http://www.skd.no/jsf/composite">
<body>
<cc:interface>
    <cc:facet name="facet" />
</cc:interface>
<cc:implementation>
    <scomp:facletsProblemCC2>
        <cc:insertFacet name="facet" />
    </scomp:facletsProblemCC2>
</cc:implementation>
</body>
</html>/

This is the component displaying the facet:

/<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
    xmlns:cc="http://java.sun.com/jsf/composite">
<cc:interface>
    <cc:facet name="facet" />
</cc:interface>
<cc:implementation>
        <cc:renderFacet name="facet" />
</cc:implementation>
</html>/

Regards

Tor Aage Ballo


--
[Message sent by forum member 'toraage']
View Post: http://forums.java.net/node/719408