3 Replies Latest reply on Jan 25, 2008 4:24 AM by Bernard Labno

    Pageflow recurence

    Bernard Labno Master

      I have following pages :
      1)/locations/browseLocations.jspx
      2)/locations/addCountry.jspx
      3)/locations/complete.jspx
      I want to add country to DB. So I place button on browseLocations.jspx :

      <s:button value="Add" view="/locations/addCountry.jspx"/>

      Now the page flow should start. But when there is a problem during countryCreator.addCountry method invocation, then I want to stay on addCountry.jspx but if I write transition to /locations/addCountry.jspx then I get Exception :
      ERROR [SeamPhaseListener] uncaught exception
      java.lang.IllegalStateException: begin() called from long-running conversation, try join=true


      addCountry.jpdl.xml
      <?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-page name="addCountry" view-id="/locations/addCountry.jspx">
       <redirect/>
       <transition name="next" to="evaluateSuccess">
       <action expression="#{countryCreator.addCountry}" />
       </transition>
       <transition name="cancel" to="cancel"/>
       </start-page>
       <decision name="evaluateSuccess" expression="#{countryCreator.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">
       <redirect/>
       </page>
       <page name="cancel" view-id="/locations/browseLocations.jspx">
       <end-conversation before-redirect="true"/>
       <redirect/>
       </page>
      </pageflow-definition>

      pages.xml
      <pages>
       <page view-id="/locations/addCountry.jspx">
       <begin-conversation pageflow="addCountry"/>
       </page>
      </pages>


      Now, if I cut out everything from pages.xml then there is no conversation at all, and I cannot add anything, nor can display FacesMessages.
      Is there other solution than introducing <start-state> and inserting method annotated with @Begin(pageflow="addCountry") in countryCreator bean ?