users@javaserverfaces.java.net

Re: How do I use the NavigationHandler.public void beforePhase(PhaseEvent event){?

From: Ryan Lubke <Ryan.Lubke_at_Sun.COM>
Date: Mon, 23 Jul 2007 11:18:27 -0700

Todd Patrick wrote:
> I have a view beforePhase attribute attached to the following method:
>
> public void beforePhase(PhaseEvent event){
> Logger log = Logger.getLogger(ClientBean.class);
> log.info(event.getPhaseId().toString());
>
> FacesContext facesContext = this.getFacesContext();
> AdfFacesContext afContext =
> AdfFacesContext.getCurrentInstance();
>
> if(ObjectUtils.equals(afContext.getProcessScope().get("clientKey"),
> null)){
> Application application = facesContext.getApplication();
> NavigationHandler nav = application.getNavigationHandler();
> nav.handleNavigation(facesContext, null, "clientsearch");
> }
> }
>
>
I believe you should add facesContext.responseComplete() before calling
handleNavigation().

> I am stepping into the if control-flow statement as I debug this in
> Netbeans 5.5.1.
>
> What I don't understand is how do I use the handleNavigation method
> properly?
>
> When I step over this statement, the page continues to load and the user
> is not redirected to the page attached to the JSF navigation-case
> "clientsearch" does not render.
>
> I'd appreciate any thoughts or help with this.
>
> Thanks,
>
> --Todd Patrick
>
> -----------------------------------------
> NOTICE: This email message is for the sole use of the intended
> recipient(s) and may contain confidential and privileged
> information. Any unauthorized use, disclosure or distribution is
> prohibited. If you are not the intended recipient, please contact
> the sender by reply email and destroy all copies of the original
> message.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_javaserverfaces.dev.java.net
> For additional commands, e-mail: users-help_at_javaserverfaces.dev.java.net
>
>