webtier@glassfish.java.net

Re: [webtier] Question about Jim Driscoll's Ajax EditText Component Example

From: Jim Driscoll <Jim.Driscoll_at_Sun.COM>
Date: Sun, 08 Feb 2009 10:06:29 -0800

Well, I don't think we have a test that combines composite:actionSource
with composite:attribute method-signature, so you may have found a new
bug. If you remove the actionSource def, does it still fail?

Jim

On 2/8/09 9:30 AM, Lincoln Baxter, III wrote:
> Good call.
>
> My first thought is that I should probably get a more descriptive
> exception, even if I'm using it wrong.
> However, I get the same result :( This is what I did... irrelevant parts
> excluded.
>
> *Bean:*
>
> public void nameListener(final ActionEvent event)
> {
> System.out.println("Listened");
> }
>
>
> *Consumer:*
>
> <a:editText value="#{viewProjectBean.projectGoals}"
> submitListener="#{viewProjectBean.nameListener}" />
>
> *Component:*
>
> <composite:interface name="editText"
> displayName="Editable Text Component"
> shortDescription="Editable Text Component">
> <composite:attribute name="submitListener" targets="submit"
> required="true"
> method-signature="void f1(javax.faces.event.ActionEvent)" />
> <composite:attribute name="value" required="true" type="String" />
> <composite:actionSource name="submit" />
> </composite:interface>
>
> <composite:implementation>
> .....
> <h:commandButton value="Submit" id="submit"
> actionListener="#{compositeComponent.attrs.submitListener}"
> onclick="return submitButton('#{compositeComponent.clientId}',
> event);">
> </h:commandButton>
> <h:commandButton value="Cancel" id="cancel" styleClass="faded"
> onclick="return cancelButton('#{compositeComponent.clientId}');" />
> ....
> </composite:implementation>
>
> </html>
>
>
>
> On Sun, 2009-02-08 at 08:56 -0800, Jim Driscoll wrote:
>>
>> To see how to call a listener in a component, see here:
>>
>> http://weblogs.java.net/blog/driscoll/archive/2008/12/jsf_20_wiring_u_1.html
>
>