Announcement Announcement Module
Collapse
No announcement yet.
Quitting a flow by clicking on a sidebar link in JSF Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Quitting a flow by clicking on a sidebar link in JSF

    Hi all,
    I'm using webflow 1.0.3 with JSF.
    I have a sidebar which is used for navigation in JSF. One of the links in the sidebar starts a flow. However, I want the user to be able to click any of the links on the sidebar, and quit the flow.
    I have defined navigation rules in faces-config.xml:
    For example : when the user clicks on a commandLink in the sidebar that returns sideA he expects to go to panelA.jsp:
    <navigation-rule>
    <from-view-id>*</from-view-id>
    <navigation-case>
    <from-outcome>sideA</from-outcome>
    <to-view-id>/ui/panelA.jsp</to-view-id>
    </navigation-case>
    ...
    </navigation-rule>
    However, the above navigation rule is not considered when inside a flow. I get the following exception when the the sidebar link is clicked:

    org.springframework.webflow.engine.NoMatchingTrans itionException: No transition found on occurence of event 'sideA' in state 'enterAdminDetails' of flow 'init-admin-flow' -- valid transitional criteria are array<TransitionCriteria>[[eventId = 'next'], [eventId = 'back']] -- likely programmer error, check the set of TransitionCriteria for this state

    I am using the FlowPhaseListener as suggested by the sell-item example:
    <application>
    <navigation-handler>org.springframework.webflow.executor.jsf.F lowNavigationHandler</navigation-handler>
    <variable-resolver>org.springframework.webflow.executor.jsf. DelegatingFlowVariableResolver</variable-resolver>
    </application>
    <lifecycle>
    <phase-listener>org.springframework.webflow.executor.jsf. FlowPhaseListener</phase-listener>
    </lifecycle>

    The sidebar used to work in webflow 1.0.1...
    Appreciate any help!
    Thanks,
    Sriram

  • #2
    Add your side menu JSF button code, I suspect it might be wrong.

    Comment


    • #3
      <h:commandLink action="#{sessionBean.changeLinkAction}" />
      changeLinkAction() returns a String : "sideA"
      which in faces-config should direct to ui/panelA.jsp

      Comment


      • #4
        Also, if I revert back to webflow-1.0.1, things work fine.

        Comment


        • #5
          Saroop,

          This is is due to the fact that in 1.0.3 the Web Flow flow execution key is tracked automatically in the JSF component tree. The key is being post back and your flow execution is restored; the FlowNavigationHandler then tries to signal an event against it with the JSF action outcome.

          So basically, in this case, you're expected to route this event through SWF for handling there. You can read more about how this works here: http://blog.interface21.com/main/200...sf-developers/

          Tracking the flow execution key automatically is a great feature, as it keeps view developers from having to manage it. We should consider, though, if it makes sense to also allow "standard" navigation handler to take precedence for handling an JSF action outcome even if the view is participating in a flow. If so, we need to brainstorm an approach to doing this...

          Keith

          Comment


          • #6
            Thanks for the info Keith.
            Tracking the flow execution key definitely is a neat idea. However, if you could consider allowing the standard faces-config navigation handler(either take precedence over the flow handler or act as a default handler if SWF cannot handle it), that would save folks like me a lot of trouble.

            For existing JSF based systems, the faces-config file can be quite large. It would be difficult to migrate to a flow-based system in one go, and for such a case it would be quite a hassle to handle all the JSF events that may occur with a flow using SWF.
            Hope you would consider this in your future releases.
            Thanks!
            Sriram

            Comment


            • #7
              We will restore this capability. It's important for 1.0.x releases to be backwards compatible and this was an oversight in 1.0.3 we will correct in a 1.0.4. Watch for a 1.0.4 nightly build to be available with a fix.

              The proposed fix will signal the outcome as an event against the current state of the flow execution. If the event cannot be matched (NoMatchingTransitionException), the default navigation handler will handle it. It's not quite entirely the same semantics, but pretty close...

              Keith
              Last edited by Keith Donald; Apr 30th, 2007, 06:25 PM.

              Comment


              • #8
                We have restored this compatability as outlined and committed a patch to the Web Flow 1.0 and 1.1 branches.

                If you could try out the latest 1.0.4 nightly build and let us know if this solves your issue, that'd be great.

                The nightly builds are available here:
                http://static.springframework.org/do...hp?project=SWF

                Comment


                • #9
                  Hi Keith,
                  I tried out yesterday's 1.0.4 snapshot. The NoMatchingTransitionException is being caught and I can see from the webflow debug logs that is trying to fallback to the JSF navigation handler. However, the transition does not seem to be happening. The page remains stuck as before (the current view in the flow). Am I missing something ?

                  These are the logs:

                  2007-05-08 12:06:07,908 DEBUG [org.springframework.webflow.engine.impl.FlowExecut ionImpl] - <Attempting to handle [org.springframework.webflow.engine.NoMatchingTran
                  sitionException: No transition found on occurence of event 'configPanel' in state
                  'showError' of flow 'ad-config-flow' -- valid transitional criteria are array<Tran
                  sitionCriteria>[[eventId = 'back']] -- likely programmer error, check the set of T
                  ransitionCriteria for this state]>
                  2007-05-08 12:06:07,908 DEBUG [org.springframework.webflow.engine.impl.FlowExecut ionImpl] - <Rethrowing unhandled flow execution exception>
                  2007-05-08 12:06:07,908 DEBUG [org.springframework.webflow.executor.jsf.FlowNavig ationHandler] - <No flow state transition found for event 'configPanel'; falling back to standard navigation handler.>
                  2007-05-08 12:06:07,908 DEBUG [org.springframework.webflow.engine.impl.FlowExecut ionImpl] - <Resuming execution for refresh>
                  2007-05-08 12:24:03,084 DEBUG [org.springframework.webflow.engine.impl.FlowExecut ionImpl] - <Paused to render '/ui/f_showError.jsp' [[adDomain, initadmin, currentFormObject, adHolder]] and wait for user input>
                  2007-05-08 12:24:03,959 DEBUG [org.springframework.webflow.executor.jsf.FlowPhase Listener] - <Saving execution to repository with key _cA276AF9B-6465-7463-C321-1643
                  B83A0C3A_k166BC4F6-C23F-F539-3DE5-C38F7CDD4D84>

                  I have the following in my faces-config.xml :
                  <navigation-rule>
                  <from-view-id>*</from-view-id>
                  <navigation-case>
                  <from-outcome>configPanel</from-outcome>
                  <to-view-id>/ui/configPanel.jsp</to-view-id>
                  </navigation-case>
                  ...

                  Thanks,
                  Sriram

                  Comment


                  • #10
                    Hi Keith,
                    Any ideas about this ? It looks like the JSF navigation handler is not being invoked properly...
                    Thanks,
                    Sriram

                    Comment

                    Working...
                    X