Announcement Announcement Module
Collapse
No announcement yet.
Troubles calling the same View State Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Troubles calling the same View State

    Hi all,

    I donít know if someone can help me out with this issue

    I'm working with spring web flow and in a specific transaction I'm calling the same view state several times, as you can see below in Web flow Code .

    If I click on submit I call the controller and saveLineSale, but I can save more than one line, so if I click on submit again I call saveLineSale and so on.

    Web flow Code

    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">
    
        <on-start>
            <evaluate expression="controller.getBean(flowRequestContext)" result="flowScope.sale"/>
        </on-start>
    
        <view-state id="new" view="sale/newSale" model="sale">
            <transition on="submit" to="new">
                <evaluate expression="controller.saveLineSale(flowRequestContext, sale)"/>
            </transition>
            <transition on="deleteLine" to="new">
                <evaluate expression="controller.deleteLine(flowRequestContext, sale)"/>
            </transition>
            <transition on="finish" to="result">
                <evaluate expression="controller.sendMail(flowRequestContext)"/>
            </transition>
        </view-state>
    
        <end-state id="result" view="result">
            <on-entry>
                <evaluate expression="controller.result(flowRequestContext, flowScope.sale)"/>
            </on-entry>
        </end-state>
    
    </flow>
    Controller Code
    Code:
     public Boolean saveLineSale(RequestContext context, Bean bean) {
    
      // save the bean
      manager.save(bean);
      // retreive all bean previuly saved
      List<Bean> list = loadAllBean();
      //  put them in flow to list
      context.getFlowScope().put("listBean", list);
      return true;
    }
    The problem is that It only works for 3 time, yes, it sounds crazy but It save the first line and the second one but the third time that I click on submit it stay in the same page like when click F5.... It never hit the controller again...

    Anyone can help me pleas

  • #2
    What does your view look like?

    Comment

    Working...
    X