4 Replies Latest reply on Jan 2, 2008 12:58 PM by gazadonf

    pageflow and parameters transmition

    gazadonf

      Hy all.

      I don't anderstand why there's such a difference between page.xml navigation and pageflow navigation... It sucks!!!!

      My problem is:

      i have a list of element and i want to edit one of them.

      When i use page.xml to navigate between the list page and the edit page, there's no problem to get the instance of the objet i want to edit.
      Seam generator do it well.

      In my listPage.xhtml, there's table of instance and a parameter define like this

      <f:param name="historyId" value="#{history.id}"/>
      

      in the link definition

      <s:link view="/#{empty from ? 'History' : from}.xhtml"
       value="Select"
       id="history">
       <f:param name="historyId"
       value="#{history.id}"/>
       </s:link>


      In my destiantion page.xml, i retrieve this parameter define like this
      <param name="historyId" value="#{historyHome.historyId}"/>

      and then, used in my destination page like this
      <h:outputText value="#{historyHome.instance.startDate}">


      When i want to replace all page.xml by one navigation pageflow, i replace all of this by:

      s:link
      <s:link action="consultHistory"
       value="Select"
       id="history">

      f:param is the same

      h:outputText is the same too

      and in my pageflow i do this:
      <page name="gestionProject" view-id="/project/HistoryList.xhtml">
       <redirect/>
       <transition to="consultHistory" name="consultHistory" >
       <param name="historyId" value="#{historyHome.historyId}"/>
       </transition>
      </page>
      
      <page name="consultHistory" view-id="/project/History.xhtml">
       <redirect/>
       <transition to="gestionProject" name="retour"></transition>
      </page>


      but i do not retrieve anything...

      I also try
      <page name="gestionProject" view-id="/project/HistoryList.xhtml">
       <redirect/>
       <transition to="consultHistory" name="consultHistory" >
       </transition>
      </page>
      
      <page name="consultHistory" view-id="/project/History.xhtml">
       <param name="historyId" value="#{historytHome.historyId}"/>
       <redirect/>
       <transition to="gestionProject" name="retour"></transition>
      </page>


      but it doesn't work as well...

      What's wrong with that?????

      I try to find somme help in the samples projets of seam 2.0, but only numberguess use pageflow, and there's no direct transmission between pages...

      And when i do something like this
      <s:link action="consultProject"
       value="Select"
       id="project">
       <f:param name="projectId"
       value="#{projectHome.setProjectId(project.id)}"/>
       </s:link>


      without any parameter definition in the pageflow only the last instance is transmit to the next page, even if i click on the first one...

      What is the solution??? Please...



      here is the complete table code
      <rich:dataTable id="projectList"
       var="project"
       value="#{projectList.resultList}"
       rendered="#{not empty projectList.resultList}"
       onRowMouseOver="this.style.backgroundColor='#F1F1F1'"
       onRowMouseOut="this.style.backgroundColor='#{a4jSkin.tableBackgroundColor}'">
      
       <h:column name="idProject">
       <f:facet name="header">
       <s:link styleClass="columnHeader"
       value="id #{projectList.order=='id asc' ? messages.down : ( projectList.order=='id desc' ? messages.up : '' )}">
       <f:param name="order" value="#{projectList.order=='id asc' ? 'id desc' : 'id asc'}"/>
       </s:link>
       </f:facet>
       #{project.id}
       </h:column>
       <h:column>
       <f:facet name="header">
       <s:link styleClass="columnHeader"
       value="history id #{projectList.order=='history.id asc' ? messages.down : ( projectList.order=='history.id desc' ? messages.up : '' )}">
       <f:param name="order" value="#{projectList.order=='history.id asc' ? 'history.id desc' : 'history.id asc'}"/>
       </s:link>
       </f:facet>
       #{project.history.id}
       </h:column>
       <h:column>
       <f:facet name="header">
       <s:link styleClass="columnHeader"
       value="idMantis #{projectList.order=='idMantis asc' ? messages.down : ( projectList.order=='idMantis desc' ? messages.up : '' )}">
       <f:param name="order" value="#{projectList.order=='idMantis asc' ? 'idMantis desc' : 'idMantis asc'}"/>
       </s:link>
       </f:facet>
       #{project.idMantis}
       </h:column>
       <h:column>
       <f:facet name="header">
       <s:link styleClass="columnHeader"
       value="title #{projectList.order=='title asc' ? messages.down : ( projectList.order=='title desc' ? messages.up : '' )}">
       <f:param name="order" value="#{projectList.order=='title asc' ? 'title desc' : 'title asc'}"/>
       </s:link>
       </f:facet>
       #{project.title}
       </h:column>
       <h:column>
       <f:facet name="header">action</f:facet>
       <s:link action="consultProject"
       value="Select"
       id="project">
       <f:param name="projectId"
       value="#{projectHome.setProjectId(project.id)}"/>
       </s:link>
       </h:column>
       </rich:dataTable>


        • 1. Re: pageflow and parameters transmition
          pmuir

          Do you still have the param defined in pages.xml?

          • 2. Re: pageflow and parameters transmition
            gazadonf

            Hi, and happy new year to all of you.

            No i don't.

            I suppressed all of myPageNamepage.xml in the WebContent and in my pages.xml i only have reference to my pagefolws.

            Here is 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"
             login-view-id="/login.xhtml"
             no-conversation-view-id="/index.xhtml">
            
             <page view-id="/login.xhtml">
             <navigation from-action="#{identity.login}">
             <rule if="#{identity.loggedIn}">
             <redirect view-id="/Activity.xhtml"/>
             </rule>
             </navigation>
             </page>
             <page view-id="/Activity.xhtml" login-required="true">
             <begin-conversation join="true" pageflow="monPageflow"/>
             </page>
            
             <page view-id="*">
             <navigation from-action="#{identity.logout}">
             <end-conversation/>
             <redirect view-id="/login.xhtml"></redirect>
             </navigation>
             </page>
            
            
             <exception class="org.jboss.seam.framework.EntityNotFoundException">
             <redirect view-id="/error.xhtml">
             <message>Not found</message>
             </redirect>
             </exception>
            
             <exception class="javax.persistence.EntityNotFoundException">
             <redirect view-id="/error.xhtml">
             <message>Not found</message>
             </redirect>
             </exception>
            
             <exception class="javax.persistence.OptimisticLockException">
             <end-conversation/>
             <redirect view-id="/error.xhtml">
             <message>Another user changed the same data, please try again</message>
             </redirect>
             </exception>
            
             <exception class="org.jboss.seam.security.AuthorizationException">
             <redirect view-id="/error.xhtml">
             <message>You don't have permission to do this</message>
             </redirect>
             </exception>
            
             <exception class="org.jboss.seam.security.NotLoggedInException">
             <redirect view-id="/login.xhtml">
             <message>Please log in first</message>
             </redirect>
             </exception>
            
             <exception class="javax.faces.application.ViewExpiredException">
             <redirect view-id="/error.xhtml">
             <message>Your session has timed out, please try again</message>
             </redirect>
             </exception>
            
             <exception class="javax.faces.application.IllegalNavigationException">
             <redirect view-id="/error.xhtml">
             <message>Your session has timed out, please try again</message>
             </redirect>
             </exception>
            
             <exception>
             <redirect view-id="/error.xhtml">
             <message>Unexpected error, please try again</message>
             </redirect>
             </exception>
            
            
            
            </pages>
            
            


            • 3. Re: pageflow and parameters transmition
              pmuir

              You need them ;) - otherwise the home doesn't know which object to manage.

              • 4. Re: pageflow and parameters transmition
                gazadonf

                Ok, after serveral tries, it works...

                I notice that i have to declare nox parameters in the departure page définition instead of the arrival page when using a pageflow definition, like this:

                <page view-id="/project/ProjectList.xhtml">
                 <param name="theProject" value="#{projectHome.projectId}"/>
                </page>
                


                Is it normal?