Results 1 to 4 of 4

Thread: Redirect to specific state in the flow

  1. #1
    Join Date
    Mar 2011
    Posts
    5

    Default 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. #2
    Join Date
    Jan 2011
    Location
    Laramie, WY
    Posts
    2

    Default

    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'.

  3. #3

    Default

    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?

  4. #4
    Join Date
    Mar 2011
    Posts
    5

    Default

    Thanks for your replies

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •