JSF f:event execution order

jsf-2

Solution

The spec doesn't seem to explicitly state that anywhere.

The `Application#publishEvent()` API mentions that they are obtained and processed as a `List` which is by nature ordered. Both the Mojarra and MyFaces implementations confirms this by storing them in a `CopyOnWriteArrayList` and `ArrayList` respectively.

So, logically based on the the API and the both implementations, they are indeed executed in order, if added to the same parent UI component.

Problem

Suppose I have multiple f:event tags to process the same kind of event: ``` <f:event type="preRenderView" listener="#{myBean.action1()} /> <f:event type="preRenderView" listener="#{myBean.action2()} /> ``` Is the order of execution guaranteed? Edit: To clarify why I need them to be executed in specific order, here is my use case: myBean#action1 is actually a setter myBean#action2 is a method that operates on a field set by action1 In my opinion, the order is unreliable, that's why I simply put them as `EL expressions` inside my facelet like this: ``` <p:ouputPanel> #{myBean.action1()} #{myBean.action2()} </p:ouputPanel> ```

Original source