jsr372-experts@javaserverfaces-spec-public.java.net

[jsr372-experts] Re: [jsr372-experts mirror] Re: UICommand#decode() ordering of client behavior events and action event not consistent in Mojarra and MyFaces

From: Leonardo Uribe <leonardo.uribe_at_irian.at>
Date: Fri, 6 Mar 2015 14:46:47 -0500

Hi

There is nothing in the spec that specifies the order (renderkit
javadoc "General notes on decoding").

I remember the logic is the component must be decoded first and then
the listeners, because for example in a inputText component you need
the value to be updated before the listener, but I suppose this is an
special case, because the navigation has a special meaning.

But in this case, an ActionEvent is queued, so the real invocation
happens on broadcast(). AjaxBehaviorEvent is queued after ActionEvent.

It looks like something that we can fix on h:commandButton and
h:commandLink renderer class. But please note this is more an
exception than the general case.

regards,

Leonardo Uribe

2015-03-06 13:57 GMT-05:00 Michael Müller <michael.mueller_at_mueller-bruehl.de>:
> I expected it this way too. I might need to be clarified.
>
> Same for
> <h:commandLink action="#{bean.action} listener="#{bean.listener}" />
>
>
> Herzliche Grüße - Best Regards,
>
> Michael Müller
>
> Read my book "Web Development with Java and JSF": https://leanpub.com/jsf
>
>
> Am 06.03.2015 um 17:47 schrieb Cagatay Civici:
>>
>> I also expect listeners getting invoked before action.
>>
>> Cagatay Civici
>> PrimeFaces Lead
>> PrimeTek Informatics
>> www.primefaces.org
>>
>>
>> On Friday 6 March 2015 at 18:46, Bauke Scholtz wrote:
>>
>>> Indeed, exactly as how actionListener/action work right now.
>>>
>>> Cheers, B
>>>
>>> On Fri, Mar 6, 2015 at 5:11 PM, arjan tijms <arjan.tijms_at_gmail.com
>>> (mailto:arjan.tijms_at_gmail.com)> wrote:
>>>>
>>>> Hi,
>>>>
>>>> I'd say the general expectation is that listeners are always invoked
>>>> first, and the action is the final thing called.
>>>>
>>>> Kind regards,
>>>> Arjan
>>>>
>>>>
>>>>
>>>> On Fri, Mar 6, 2015 at 4:29 PM, Bauke Scholtz <balusc_at_gmail.com
>>>> (mailto:balusc_at_gmail.com)> wrote:
>>>>>
>>>>> Hi,
>>>>>
>>>>> Trigger:
>>>>> http://stackoverflow.com/q/28901284
>>>>>
>>>>> Code:
>>>>> <h:commandLink action="#{bean.action}">
>>>>> <f:ajax listener="#{bean.listener}" />
>>>>> </h:commandLink>
>>>>>
>>>>> Mojarra:
>>>>> Listener is first invoked and then action.
>>>>>
>>>>> MyFaces:
>>>>> Action is first invoked and then listener.
>>>>>
>>>>> Who's correct? I couldn't find this in the spec. We need to align out
>>>>> it. As
>>>>> the action is supposed to be definitive (because of the navigation case
>>>>> outcome), I find Mojarra behavior is correct.
>>>>>
>>>>> Cheers, B
>>>
>>>
>>
>>
>