webtier@glassfish.java.net

Re: composite component with "for" attribute in jsf2.0 - is it possible?

From: <webtier_at_javadesktop.org>
Date: Thu, 01 Apr 2010 04:31:13 PDT

Try the following:

[code]
<?xml version="1.0" encoding="UTF-8" ?>
<!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:h="http://java.sun.com/jsf/html"
      xmlns:composite="http://java.sun.com/jsf/composite"
      xmlns:ui="http://java.sun.com/jsf/facelets">
<composite:interface>
    <composite:attribute name="for" required="true" />
</composite:interface>
<composite:implementation>
    <span id="#{cc.clientId}">
        <ui:repeat value="#{facesContext.getMessageList(cc.attrs.for)}" var="_msg">
            <h:outputText value="#{_msg.summary}"/><br/>
        </ui:repeat>
    </span>
</composite:implementation>
</html>
[/code]

It worked on GlassFish v3.
[Message sent by forum member 'vesuvius']

http://forums.java.net/jive/thread.jspa?messageID=394882