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