8 Replies Latest reply on Feb 18, 2008 8:38 PM by diegocoronel

    Seam always creating 2 conversations

    diegocoronel

      Hey,


      Im with problems about seam conversations, my page.xml



      <?xml version="1.0" encoding="UTF-8"?>
      <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_fornecedores/pesquisar.seam"
            login-required="true">
            
          <begin-conversation join="true" flush-mode="manual"/>
              <navigation>
                <rule if-outcome="inserir">
                     <redirect view-id="/face/almoxarifado/cadastro_fornecedores/inserir.seam"/>
                </rule>
                <rule if-outcome="editar">
                     <redirect view-id="/face/almoxarifado/cadastro_fornecedores/editar.seam"/>
                </rule>
           </navigation>
         
      </page>





      and my xhtml:




      <fpf:titlePanel title="#{msgCadastroFornecedores.pesquisar}" />
                     
                     <a4j:outputPanel id="msg">
                          <fpf:messages />
                     </a4j:outputPanel>
                          
                     <fpf:container label="#{msg.pesquisarPor}" width="525px"> 
                          <table width="100%">
                               <tr>
                                    <td colspan="2">
                                         <!-- FIELDS -->     
                                         <fpf:input id="nomeFantasia" label="#{msgCadastroFornecedores.txNomeFantasia}" value="#{cadastroFornecedoresBean.fornecedor.txNomeFantasia}" size="50" maxlength="50"/>
                                         <fpf:input id="razaoSocial" label="#{msgCadastroFornecedores.txRazaoSocial}" value="#{cadastroFornecedoresBean.fornecedor.txRazaoSocial}" size="50" maxlength="50"/>
                                         <fpf:input id="pessoaContato" label="#{msgCadastroFornecedores.txContato}" value="#{cadastroFornecedoresBean.fornecedor.txPessoaContato}" size="50" maxlength="50"/>
                                    </td>
                               </tr>
                               <tr>
                                    <td width="80px">
                                         <fpf:ajaxButton label="#{msg.btPesquisar}" managedBean="#{cadastroFornecedoresBean}" method="searchFornecedores" reRender="GRIDFornecedor,msg">
                                         </fpf:ajaxButton>
                                    </td>
                                    <td height="5px"/>
                               </tr>
                          </table>
                     </fpf:container>          
                     <!-- GRID -->
                     <table width="100%">
                          <tr>
                               <td colspan="2">
                                    <a4j:outputPanel id="GRIDFornecedor">
                                         <fpf:grid dados="#{cadastroFornecedoresBean.resultList}" msgNotFound="#{msgCadastroFornecedores.zeroDadosGrid}" id="gr">
                                                <f:facet name="header">
                                                <rich:columnGroup > 
                                                    <rich:column>     
                                                        <h:outputText value="#{msgCadastroFornecedores.txNomeFantasia}" />
                                                   </rich:column>
                                                  <rich:column>
                                                      <h:outputText value="#{msgCadastroFornecedores.txRazaoSocial}" />
                                                  </rich:column>
                                                  <rich:column>            
                                                      <h:outputText value="#{msgCadastroFornecedores.txContato}" />
                                                  </rich:column>
                                                  <rich:column>
                                                      <h:outputText value="#{msgCadastroFornecedores.txEmail}" />
                                                  </rich:column>
                                                          <rich:column width="15px">
                                                      <h:outputText value="#{msg.acao}" />
                                                  </rich:column>                                       
                                              </rich:columnGroup>
                                            </f:facet>
                                                <rich:column>
                                                    <h:commandLink action="#{cadastroFornecedoresBean.actionEdit}" styleClass="commandLinkStyle" >      
                                                      <h:outputText value="${item.txNomeFantasia}" />
                                                      <f:setPropertyActionListener value="#{item}" target="#{cadastroFornecedoresBean.fornecedor}" />
                                                 </h:commandLink>
                                            </rich:column>  
                                           <rich:column>
                                               <h:outputText value="${item.txRazaoSocial}" />
                                           </rich:column>  
                                           <rich:column>
                                               <h:outputText value="${item.txPessoaContato}" />
                                           </rich:column> 
                                           <rich:column>
                                               <h:outputText value="${item.txEmail}" />
                                           </rich:column>
                                           <rich:column style="width:15px">
                                                <center>
                                                        <h:commandButton styleClass="bt_deletar" action="#{cadastroFornecedoresBean.actionDelete(item)}" alt="#{msgCadastroFornecedores.icoExcluir}" title="#{msgCadastroFornecedores.icoExcluir}" onmouseover="className='bt_deletar_f2'" onmouseout="className='bt_deletar'" onclick="if (!confirm('#{msg.msgExclusao}')) return false"/>
                                                </center>
                                            </rich:column>
                                           </fpf:grid>
                                      </a4j:outputPanel>
                                 </td>
                          </tr>
                     </table>
                     <p/>
                     <!-- BUTTONS -->
                     <table>
                          <tr>
                               <td>
                                    <fpf:button label="#{msg.btNovo}" managedBean="#{cadastroFornecedoresBean}" method="actionInsert" />
                               </td>
                          </tr>
                     </table>
                </h:form>    
           </ui:define> 
      </ui:composition>







      My problem is everytime i access my pages two conversations are created, my debug.seam:


      35      14:29:45 -14:29:46             /face/almoxarifado/cadastro_fabricante/pesquisar.xhtml       Select conversation context
      34      14:29:44 -14:29:45             /face/almoxarifado/cadastro_fabricante/pesquisar.xhtml       Select conversation context



      Any ideia ? is this normal ?


      Seam 2.0.1.GA
      Jboss 4.2.2
      Windows XP

        • 1. Re: Seam always creating 2 conversations
          monkeyden
          Presumably because that begin <begin-conversation> is not within the scope of a page or navigation rule.  Seam creates one and this tag creates one.  You get the Seam-created conversation at no extra charge.
          • 2. Re: Seam always creating 2 conversations
            diegocoronel

            Kyle Burke wrote on Feb 15, 2008 04:05 PM:


            Presumably because that begin begin-conversation is not within the scope of a page or navigation rule.  Seam creates one and this tag creates one.  You get the Seam-created conversation at no extra charge.


            ty for answer, but i didnt understand, what should i do ? do you think there is another page.xml creating a conversation ?


            • 3. Re: Seam always creating 2 conversations
              diegocoronel

              i think join true was to join with any conversation started in that tab, or to prevent creating 2 or more conversations, my problem is what can i do to make it works correct ?

              • 4. Re: Seam always creating 2 conversations
                monkeyden

                Look at the examples, to see where begin-conversation should be.


                Something like this:


                <page view-id="/numberGuess.jspx">
                    <begin-conversation join="true" pageflow="numberGuess"/>
                </page>

                • 5. Re: Seam always creating 2 conversations
                  diegocoronel

                  Kyle Burke wrote on Feb 15, 2008 06:42 PM:


                  Look at the examples, to see where begin-conversation should be.

                  Something like this:

                  <page view-id="/numberGuess.jspx">
                      <begin-conversation join="true" pageflow="numberGuess"/>
                  </page>




                  hi kyle, but i need to do it in my pages.xml ? isnt this the same as


                  <?xml version="1.0" encoding="UTF-8"?>
                  <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_fornecedores/pesquisar.seam"
                        login-required="true">
                        
                      <begin-conversation join="true" flush-mode="manual"/>
                          <navigation>
                            <rule if-outcome="inserir">
                                 <redirect view-id="/face/almoxarifado/cadastro_fornecedores/inserir.seam"/>
                            </rule>
                            <rule if-outcome="editar">
                                 <redirect view-id="/face/almoxarifado/cadastro_fornecedores/editar.seam"/>
                            </rule>
                       </navigation>
                     
                  </page>



                  when i have my pesquisar.xhtml and my pesquisar.page.xml in same directory isnt the same as you said ?


                  ty again

                  • 6. Re: Seam always creating 2 conversations
                    monkeyden

                    Sorry misread the XML.  Is this your complete pages.xml file?  You need to wrap the page tag(s) in a pages tag.

                    • 7. Re: Seam always creating 2 conversations
                      diegocoronel

                      Kyle Burke wrote on Feb 15, 2008 07:02 PM:


                      Sorry misread the XML.  Is this your complete pages.xml file?  You need to wrap the page tag(s) in a pages tag.


                      my pages.xml


                      <?xml version="1.0" encoding="UTF-8"?>
                      <pages xmlns="http://jboss.com/products/seam/pages"
                             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                             xsi:schemaLocation="http://jboss.com/products/seam/pages http://jboss.com/products/seam/pages-2.0.xsd"
                             no-conversation-view-id="/layout/login.xhtml"
                             login-view-id="/layout/login.xhtml">
                      
                          <page view-id="*">
                              <navigation>
                                  <rule if-outcome="home">
                                      <redirect view-id="/layout/login.xhtml"/>
                                  </rule>
                              </navigation>
                          </page>
                          <exception class="org.jboss.seam.security.NotLoggedInException">
                                <redirect view-id="/layout/login.xhtml">
                                </redirect>
                           </exception>
                          
                      </pages>




                      and my pesquisar.page.xml (its creating 2 conversations)


                      <?xml version="1.0" encoding="UTF-8"?>
                      <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_fornecedores/pesquisar.seam"
                            login-required="true">
                            
                          <begin-conversation join="true" flush-mode="manual"/>
                              <navigation>
                                <rule if-outcome="inserir">
                                     <redirect view-id="/face/almoxarifado/cadastro_fornecedores/inserir.seam"/>
                                </rule>
                                <rule if-outcome="editar">
                                     <redirect view-id="/face/almoxarifado/cadastro_fornecedores/editar.seam"/>
                                </rule>
                           </navigation>
                         
                      </page>



                      is it wrong ?

                      • 8. Re: Seam always creating 2 conversations
                        diegocoronel

                        i need help pls, anyone have suggestion ?? ill try anything. ty