webtier@glassfish.java.net

Re: [webtier] The "class" attribute of composite components

From: Ed Burns <Ed.Burns_at_Sun.COM>
Date: Mon, 10 Aug 2009 11:44:56 -0700

>>>>> On Mon, 10 Aug 2009 11:37:31 -0700, Ed Burns <ed.burns_at_sun.com> said:

>>>>> On Sat, 01 Aug 2009 16:39:49 -0700 (PDT), webtier_at_javadesktop.org said:
RO> There is a cool small feature of Facelets that allows the usage of "class" as a component attribute. You can use it for Facelet tags and even for the standard component set like this:
RO> <h:outputText value="Text" class="text" />

EB> I'm investigating this now.

I understand that you want to use the actual attribute name "class", and
agree you should be able to do so. However, because of its meaning in
the Java world, our current system doesn't support it. What you *can*
do in JSF 2.0 right now, is use something other than class. Like this.

using page:

<p><my:myComponent myClass="fozzy" /></p>

comComp: myComponent.xhtml

<cc:implementation>

    <div class="#{cc.attrs.myClass}">

I've attached a maven war project source that shows this.

Let me know if this is sufficient.





-- 
| ed.burns_at_sun.com  | office: 408 884 9519 OR x31640
| homepage:         | http://ridingthecrest.com/