webtier@glassfish.java.net

Re: JSF 2.0 composite components with method-valued attributes

From: <webtier_at_javadesktop.org>
Date: Mon, 18 May 2009 07:47:40 PDT

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 backing bean class only to composite component and set method names and field values there.

Thanks in advance.
Sorry if I ask on wrong place.
[Message sent by forum member 'b_b' (b_b)]

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