myfaces-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Leonardo Uribe <>
Subject Re: Understanding page lifecycle on return from a faces flow
Date Fri, 07 Nov 2014 05:22:43 GMT

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

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.


Leonardo Uribe

2014-10-21 10:51 GMT-05:00 Alexander Wise <>:

> 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

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message