3 Replies Latest reply on Feb 3, 2008 7:22 PM by Pete Muir

    Unwanted datamodel update on action cancel

    Bernard Labno Master

      I have 2 pages :
      A) data table with entities representing countries
      B) edit form used to edit name of selected country
      Now, when i select country on page A, the form loads with input field loaded with country's name. I change value of that field to whatever else and press cancel button which takes me back to page A. But name of country that i just quit editing is changed (and even persisted) ! I do not want such bahaviour. What should I do ?
      btw. same thing happens in demo application dvd-store when you change products quantity in cart and press "Continue shopping" instead "Update and recalculate total", which in my opinion should not cause amount in cart be changed.

      <?xml version="1.0"?>
      <pageflow-definition
       xmlns="http://jboss.com/products/seam/pageflow"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xsi:schemaLocation="http://jboss.com/products/seam/pageflow http://jboss.com/products/seam/pageflow-2.0.xsd"
       name="addCountry">
      
       <start-state name="start">
       <transition to="addCountry"/>
       </start-state>
      
       <page name="addCountry" view-id="/locations/addCountry.jspx" no-conversation-view-id="/locations/browseLocations.jspx">
       <redirect/>
       <transition name="next" to="evaluateSuccess">
       <action expression="#{countryManager.save}" />
       </transition>
       <transition name="cancel" to="cancel"/>
       <transition name="addRegion" to="addRegion"/>
       </page>
      
       <process-state name="addRegion">
       <sub-process name="addRegion"/>
       <transition to="addCountry"/>
       </process-state>
      
       <decision name="evaluateSuccess" expression="#{countryManager.error}">
       <transition name="false" to="complete"/>
       <transition name="true" to="addCountry"/>
       </decision>
      
       <page name="complete" view-id="/locations/complete.jspx" no-conversation-view-id="/locations/browseLocations.jspx">
       <end-conversation before-redirect="true"/>
       <redirect/>
       </page>
      
       <page name="cancel" view-id="/locations/browseLocations.jspx">
       <end-conversation before-redirect="true"/>
       <redirect/>
       </page>
      
      </pageflow-definition>