webtier@glassfish.java.net

Re: [webtier] Composite component bean class as attribute

From: Jim Driscoll <Jim.Driscoll_at_Sun.COM>
Date: Thu, 21 May 2009 13:38:24 -0700

Have you checked out my followup blog on the same topic? It's here:

http://weblogs.java.net/blog/driscoll/archive/2009/01/jsf_20_a_compon.html


Without trying your example myself, it's hard to say what error you're
getting. Are you referencing the "controller" attribute to get the
class name? Why? You should instead by referencing the
cc.attrs.controller.selected1 attribute, right?

Jim

On 5/20/09 7:48 AM, webtier_at_javadesktop.org wrote:
> Is it possible to send only bean class to composite component as attribute and set method attributes in composite component? I have found Ed Burns comment on Jim Driscoll blog http://weblogs.java.net/blog/driscoll/archive/2008/12/jsf_20_wiring_u_1.html. He claims that this is possible.
>
> EXAMPLE:
> <ez:switchlist id="switchlist" controller=#{switchListController}" />
>
> The interface declaration would then look like:
>
> <composite:interface name="switchlist"
> displayName="Switchlist Component"
> shortDescription="A basic example of the composite component feature">
>
> <composite:attribute name="controller">
> <composite:attribute name="selected1" required="true"/>
> <composite:attribute name="selected2" required="true"/>
> <composite:attribute name="items1" required="true"/>
> <composite:attribute name="items2" required="true"/>
> <composite:attribute name="move1to2" targets="move1to2" required="true" method-signature="void f1(javax.faces.event.ActionEvent)" />
> <composite:attribute name="move2to1" targets="move2to1" required="true" method-signature="void f2(javax.faces.event.ActionEvent)" />
> </composite:attribute>
> </composite:interface>
>
> I have try it but as attribute value in composite component I get actual class name (like ezcomp.InOutBean_at_15b1773).
>
> I think it is better to send only backing bean class as attribute to composite component and set method names and field values there.
>
> Thanks in advance.
> [Message sent by forum member 'b_b' (b_b)]
>
> http://forums.java.net/jive/thread.jspa?messageID=347007
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: webtier-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: webtier-help_at_glassfish.dev.java.net
>