dynamic JSF composite component styling/rendering
Posted
by
Checkoff
on Stack Overflow
See other posts from Stack Overflow
or by Checkoff
Published on 2012-09-11T23:24:14Z
Indexed on
2012/09/13
15:38 UTC
Read the original article
Hit count: 286
I've a little problem with a composite component. This component's implementation looks like:
<composite:implementation>
<h:outputStylesheet name="foo.css" library="bar"/>
<div id="#{cc.clientId}">
<composite:insertChildren/>
</div>
</composite:implementation>
It is included dynamically into a facelet page which include this component with JSTL core tags. The facelet page is similar to the following one.
<h:panelGroup id="viewport" layout="block">
<c:if test="#{controller.object != null}">
<c:forEach items="#{controller.object.elements}" var="element">
<c:if test="#{element.type == 'type1'}">
<my:componentTypeOne id="#{element.id}"/>
</c:if>
<c:if test="#{element.type == 'type2'}">
<my:componentTypeTwo id="#{element.id}"/>
</c:if>
</c:forEach>
</c:if>
</h:panelGroup>
So when I only render the viewport
of the page the components are rendered but without the stylesheet defined within the composite component my:component
. Is there any way to include the stylesheet on the fly without rendering the whole page?
EDIT: extension of the example code..
© Stack Overflow or respective owner