5 Replies Latest reply on Apr 28, 2008 5:17 PM by diegocoronel

    cant understand before-redirect=false

    diegocoronel

      Hi,


      Im ending conversation using before redirect false, but its not working, im always in same conversation, my problem: i have a search page and one page to insert, when my insert page return sucesso i want to end conversation using before redirect false to show my success message and redirect to my search page, but im in same conversation and when a click on button to go to insert page my objects are still there, and when i use before redirect true it works, but i cant show any success message because my objects are detroied, is it normal ? what should i do ?


      my seach page xml:



      <page xmlns="http://jboss.com/products/seam/pages"
            xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
            xmlns:s="http://jboss.com/products/seam/taglib"
            xsi:schemaLocation="http://jboss.com/products/seam/pages http://jboss.com/products/seam/pages-2.0.xsd"
            view-id="/face/almoxarifado/cadastro_tipomaterial/pesquisar.seam"
            login-required="true">
           
           <restrict>#{s:hasRole('mod_almoxarifado.tipoMaterial')}</restrict>
              <begin-conversation join="true" flush-mode="MANUAL" />
              <navigation>
                <rule if-outcome="inserir">
                     <redirect view-id="/face/almoxarifado/cadastro_tipomaterial/inserir.seam"/>
                </rule>
                <rule if-outcome="editar">
                     <redirect view-id="/face/almoxarifado/cadastro_tipomaterial/editar.seam"/>
                </rule>
           </navigation>
      </page>



      and my insert page xml:



      <page xmlns="http://jboss.com/products/seam/pages"
            xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
            xmlns:s="http://jboss.com/products/seam/taglib"
            xsi:schemaLocation="http://jboss.com/products/seam/pages http://jboss.com/products/seam/pages-2.0.xsd"
            view-id="/face/almoxarifado/cadastro_tipomaterial/inserir.seam"
            login-required="true">
         
         <restrict>#{s:hasRole('mod_almoxarifado.tipoMaterial')}</restrict>
              <navigation>          
                <rule if-outcome="cancel">
                     <end-conversation before-redirect="true"/>
                     <redirect view-id="/face/almoxarifado/cadastro_tipomaterial/pesquisar.seam"/>
                </rule>
                <rule if-outcome="sucesso">
                     <end-conversation before-redirect="false"/>
                     <redirect view-id="/face/almoxarifado/cadastro_tipomaterial/pesquisar.seam"/>
                </rule>
                <rule if-outcome="editar_acesso">               
                     <redirect view-id="/face/almoxarifado/cadastro_tipomaterial/editar_acesso.seam"/>
                </rule>
           </navigation>     
      </page>




      ty, sry about english

        • 1. Re: cant understand before-redirect=false
          diegocoronel

          sry, forgot to say my enviroment:




          1. JBoss Seam 2.0.1.GA

          2. JBoss 4.2.2

          3. Windows XP

          • 2. Re: cant understand before-redirect=false
            diegocoronel

            There are some weird things happening when finishing my conversation, i noticed that just the component that created the conversation is being destroyed and other components that were created in same conversation are still alive, is this normal ?

            • 3. Re: cant understand before-redirect=false
              andygibson.contact.andygibson.net

              Hey Diego,


              Take a look at this link which appears to be a similar problem that I just replying to.


              It sounds like the problem is related to the re-use of conversation instances even when you end a conversation.


              Also I believe faces messages are propagated across pages regardless of the conversation status. I think it is passed across outside of the conversation.


              If you want to start a new conversation without passing any information across, simply make sure there is no way for the conversation Id to get from one page to the next. So for example, in the button to go to the insert page, if you are using the s:button, make sure the propagation tag is set to propagation=none


              Each page runs in a conversation, even if it is a temporary conversation. If a conversation Id is passed across, that same conversation instance containing the old objects is used as the temporary conversation. If you don't pass any Id across, then seam gets a new conversation Id and a new empty conversation instance.


              Cheers,


              Andy Gibson


              • 4. Re: cant understand before-redirect=false
                diegocoronel

                Ty for reply,


                But its strange that only the managedBean that created the conversation was destroyed (at least data was cleared), i need something like kill conversation, then even if i use same ID all objects will be created.

                • 5. Re: cant understand before-redirect=false
                  diegocoronel

                  And i think redirect true and false should have same concept, false needs to not write conversationId in url like redirect true does