Michał Ziembiński
Michał Ziembiński

Reputation: 1154

How to enter or go to the next page in JSF flow

In normal way to enter to flow or go from some page to next page in flow we use

   <h:commandButton> or <h:commandLink>

But how is it possible to enter to flow or go to the next page in flow (if we currently are in flow) from backing bean?

I try to dispatch from faces context but it doesn't work. Do you know how to do it?

I use only viewnode pages. I configure a flow using a

      @FlowDefinition
      @Producent
      @Flowdefinition
               public Flow defineFlow(@FlowbuilderParameter FlowBuilder FlowBuilder){ 
     flowBuilder.id("","registerFlow");
          flowBuilder.viewNode("registerStart","/faces/start.xhtm").Markasstartnode();
flowBuilder.viewNode("step2","/faces/step2.xhtm");
     …
     }

And now i would enter to flow from backing bean. Something like

      FacesContext.getCurrenInstance().getExternalContext().dispatch("registerFlow");

I think possible i have to use FlowHandler from context

   FlowHandler handler = FacesContext.getApplication().getFlowHandler();
   handler.transition(); // and what next?

    how here i can redirect user to some viewnode of flow?

Upvotes: 0

Views: 294

Answers (0)

Related Questions