You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Leonardo Uribe <lu...@gmail.com> on 2014/11/07 06:22:43 UTC

Re: Understanding page lifecycle on return from a faces flow

Hi

I think the problem happens because the navigation is executed on invoke
application case, but by default f:viewAction is set to be executed on
invoke application phase too. Probably f:viewAction is executed before the
navigation.

Faces Flow allows to set initializer and finalizer methods, so the best way
could be do the check in a finalizer method. Or if you want, you can use
<f:event type="preRenderView" listener="#{...}"/>, to execute a method
after invoke application phase, but before render.

regards,

Leonardo Uribe

2014-10-21 10:51 GMT-05:00 Alexander Wise <sa...@clickshare.com>:

> Greetings,
>   I am trying to use a viewAction as a mechanism to enforce pre-conditions
> on pages, and am using faces flows to present any interaction required to
> enforce the preconditions. For example, imagine a “one click” ordering
> scheme, where clicking on a link takes you to the confirmation page for the
> order, but before the order can proceed, we need to make sure the customer
> is logged in (presenting a login/signup flow if they aren’t), and that they
> have a current credit card on file (presenting an update billing
> information flow if they aren’t)...
>
> I am entering the flow with a viewAction:
>
> <f:viewAction action="#{authenticator.enter}" onPostback="true" />
>
> Authenticator.enter checks the pre-condition on the page, and navigates to
> the login flow, if the user is not logged in. But, at the end of the flow,
> I want enter() to be invoked again in case their are other preconditions
> that need to be enforced. A phase listener shows all the same phases are
> being executed, but the viewAction is not getting triggered again, so
> clearly, I don’t understand the page lifecycle sufficiently…
>
> Can anybody explain why the viewAction doesn’t get triggered again, and
> what I can do to change that?
>         /s
>
>