webtier@glassfish.java.net

Re: [webtier] JSF2 Register a SetPropertyActionListener on Ajax Event?

From: <lincolnbaxter_at_gmail.com>
Date: Mon, 27 Apr 2009 17:18:08 +0000

" Couldn't the same logic be performed within the VCL implementation?"

Setpropertyactionlistener allows you to iterate over a list and set the correct value into a bean when the triggered action occurrs. (the reason iterating over a list is important is because if there were only one item, then I could load the value via another method.) How can I do that with a valueChangeListener? f:param?

Am I missing something basic here? I feel like there should be an easy way to do this, but that I'm not figuring it out.

Thanks,
Lincoln

Sent from my Verizon Wireless BlackBerry

-----Original Message-----
From: Ryan Lubke <Ryan.Lubke_at_Sun.COM>

Date: Mon, 27 Apr 2009 10:06:57
To: <webtier_at_glassfish.dev.java.net>
Subject: Re: [webtier] JSF2 Register a SetPropertyActionListener on Ajax Event?

On 4/27/09 9:54 AM, lincolnbaxter_at_gmail.com wrote:
> Yeah, sorry I copied the wrong example... But basically I'd like to
> know if something like this is possible to use
> setpropertyactionlistener on a value change event. Ive tried nesting
> it within the actionlistener tag; that didn't throw an exception, but
> it didn't do much of anything else either.
No, the purpose of setPropertyActionListener is to register an
ActionListener with the parent ActionSource component.
>
> Suggestions? Its the outcome/behavior that I'm interested in, not the
> specific implementation.
Couldn't the same logic be performed within the VCL implementation?
>
> New snippit...
>
> <f:ajax execute="assignee"> <ocp:inputOutputSelectOneMenu id="assignee"
> value="#{task.assignee}"
> editable="#{authorizationBean.isMember and task.status ne 'DONE'}"
> autocomplete="off" items="${viewStoryBean.members}">
> <f:valueChangeListener for="value"
> binding="#{taskAssigneeListener}">
>
> <f:setPropertyActionListener value="#{task}"
> target="#{taskAssigneeListener.currentTask}" />
>
>
> </f:valueChangeListener>
> </ocp:inputOutputSelectOneMenu>
> </f:ajax>
>
>
>
>
> Sent from my Verizon Wireless BlackBerry
>
> ------------------------------------------------------------------------
> *From*: Ryan Lubke
> *Date*: Mon, 27 Apr 2009 09:10:31 -0700
> *To*: <webtier_at_glassfish.dev.java.net>
> *Subject*: Re: [webtier] JSF2 Register a SetPropertyActionListener on
> Ajax Event?
> On 4/25/09 8:20 PM, Lincoln Baxter, III wrote:
>> Hi again JSF folks. I'm trying to do the following: ... but I can't
>> find an incantation that works.
>> I've tried putting <f:setPropertyActionListener> all over the place,
>> but the value is never getting set into my target... is this
>> something that is supported?
> Based on this snippet, I would expect an exception to be thrown.
> <f:setPropertyActionListener> should be nested within an ActionSource.
>>
>> Thanks,
>> Lincoln
>>
>> <f:ajax execute="assignee">
>> <f:setPropertyActionListener value="#{task}"
>> target="#{taskAssigneeListener.currentTask}" />
>> <ocp:inputOutputSelectOneMenu id="assignee"
>> value="#{task.assignee}"
>> editable="#{authorizationBean.isMember and task.status ne 'DONE'}"
>> autocomplete="off" items="${viewStoryBean.members}">
>> <f:valueChangeListener for="value"
>> binding="#{taskAssigneeListener}">
>> </f:valueChangeListener>
>> </ocp:inputOutputSelectOneMenu>
>> </f:ajax>
>