Announcement Announcement Module
Collapse
No announcement yet.
Redirect to specific state in the flow Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Redirect to specific state in the flow

    Hello,
    is there any possibility to generate url which will redirect not to first state of flow but to a specific state of flow?
    example:
    Code:
    <?xml version="1.0" encoding="UTF-8"?>
    
    <flow xmlns="http://www.springframework.org/schema/webflow"
    	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    	xsi:schemaLocation="http://www.springframework.org/schema/webflow
    		http://www.springframework.org/schema/webflow/spring-webflow-2.0.xsd"
                    start-state="allProducts">
    
    
    	<view-state id="allProducts" view="...">
    		...
    	</view-state>
    
    	<view-state id="singleProduct" view="...">
    		...
    	</view-state>	
    </flow>
    in example above starting state is 'allProducts', so when I will use url like for example this: my.site.address/productsFlow.do then it will redirect me to first state of flow (allProducts) and starts new flow. How should I write my url, that it could redirect me to state 'signleProduct', when I am in different flow? Is it possible?

  • #2
    I definitely wouldn't do this, it is of poor design to do so.

    An assest of spring is restriction and control of the state. In other words, the states are in an order for a reason, by your design.

    Although, there is a way to accomplish what you are seeking to do.

    SUBFLOW!!

    Once the subflow has reached it's end-state, then you can get back to the 'singleProduct'.

    Comment


    • #3
      There is another solution. I'm using it but I don't like very much. But I couldn't find another option. The idea is send a parameter and use a decision state depending of the parameter value:

      Code:
               <decision-state id="init">
      		<if test="requestParameters.modeView=='view'" then="view" />
      		<if test="requestParameters.modeView=='edit'" then="edit" />
      	</decision-state>
      
               <view-state id="view" view="view.xhtml"></view-state>
               <view-state id="edit" view="edit.xhtml"></view-state>
      Nevertheless, I think it isn't the best option, so if someone knows a best way to do it, I will be waiting for know it?

      Comment


      • #4
        Thanks for your replies

        Comment

        Working...
        X