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

    Unwanted datamodel update on action cancel

    blabno 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"?>
       xsi:schemaLocation="http://jboss.com/products/seam/pageflow http://jboss.com/products/seam/pageflow-2.0.xsd"
       <start-state name="start">
       <transition to="addCountry"/>
       <page name="addCountry" view-id="/locations/addCountry.jspx" no-conversation-view-id="/locations/browseLocations.jspx">
       <transition name="next" to="evaluateSuccess">
       <action expression="#{countryManager.save}" />
       <transition name="cancel" to="cancel"/>
       <transition name="addRegion" to="addRegion"/>
       <process-state name="addRegion">
       <sub-process name="addRegion"/>
       <transition to="addCountry"/>
       <decision name="evaluateSuccess" expression="#{countryManager.error}">
       <transition name="false" to="complete"/>
       <transition name="true" to="addCountry"/>
       <page name="complete" view-id="/locations/complete.jspx" no-conversation-view-id="/locations/browseLocations.jspx">
       <end-conversation before-redirect="true"/>
       <page name="cancel" view-id="/locations/browseLocations.jspx">
       <end-conversation before-redirect="true"/>