1 Reply Latest reply on Jan 4, 2010 11:27 AM by alex becker

    Lost values between 2 pages

    alex becker Newbie

      Hi.
      I have a JPDL Pageflow with 2 different Pages (inserieren and chooseRegion) and lost my values from page inserieren while i switch from inserieren to chooseRegion and back to inserieren.
      Flow:
      1. input some values on page inserieren
      2. click chooseRegion on page1 and page2 will be render
      3. on page2 i select a different region an submit the value.
      4. on page1 the new region was set but all my values from step-1 are lost.


      Can anybody help me please?
      Thanks alex


      JPDL:


      <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.1.xsd"
           name="Inserieren">
      
           <start-page name="inserieren" view-id="/katalog/inserieren/Inserieren.xhtml" back="enabled" >
                <transition name="chooseRegion" to="chooseRegion">
                </transition>
                <transition name="save" to="save"/>
                <transition name="cancel" to="complete" />
           </start-page>
      
           <decision name="save" expression="#{inserierenAction.save}">
               <transition name="true" to="complete"/>
              <transition name="false" to="inserieren"/>
           </decision>
      
           <page name="chooseRegion" view-id="/katalog/inserieren/ChooseRegion.xhtml"
                back="enabled" no-conversation-view-id="/katalog/inserieren/Inserieren.xhtml">
                <transition name="switchRegion" to="chooseRegion">
                     <action expression="#{chooseRegionManager.refreshDataModel}"></action>
                </transition>
                <transition name="submit" to="inserieren">
                     <action expression="#{inserierenAction.switchRegion(selectedRegion)}"></action>
                </transition>
                <transition name="cancel" to="inserieren" />
           </page>
      
           <page name="complete" view-id="/katalog/inserieren/Complete.xhtml" no-conversation-view-id="/katalog/inserieren/Inserieren.xhtml">
              <end-conversation/>
              <redirect/>
           </page>
      </pageflow-definition>




      page inserieren:


      <ui:define name="body">
           <script type="text/javascript">
           </script>
          <h:form id="frmInserieren">
            <s:validateAll>
              <rich:panel>
                  <f:facet name="header"><h:outputText value="#{messages['cj.jsp.inserieren.headline']}"/></f:facet>
                   <p><h:outputText value="#{messages['cj.jsp.inserieren.neu']}" /></p>
      
                      <fieldset>
                         <legend><h:outputText value="Beschreibung" /></legend>
                          <h:panelGrid columns="2" rowClasses="prop" columnClasses="name,value">
                                <s:label value="#{messages['cj.jsp.inserieren.titel']}" />
                                <h:inputText id="titel" label="#{messages['cj.jsp.inserieren.titel']}" value="#{feWo.titel}" required="true"/>
                               
                                <s:label for="region" value="#{messages['cj.jsp.inserieren.region']}" />
                                <s:div>
                                     <h:inputText id="region" label="#{messages['cj.jsp.inserieren.region']}" value="#{feWo.region.name}" readonly="true" required="true"/>
                                     <h:commandButton id="chooseRegion" value="#{messages['cj.jsp.button.waehlen']}" action="chooseRegion" immediate="true"/>
                               </s:div>                    
      
                           <h:outputLabel for="unterkunftTyp" value="#{messages['cj.jsp.inserieren.unterkunfttyp']}" />
                               <h:selectOneMenu id="unterkunftTyp" value="#{feWo.unterkunftTyp}" required="true" label="#{messages['cj.jsp.inserieren.unterkunfttyp']}">
                                 <s:selectItems value="#{enumLists.unterkunftTypList}" var="unterkunftTyp"
                                           label="#{messages[unterkunftTyp.messageCode]}"
                                           noSelectionLabel="#{messages['cj.jsp.listbox.bittewaehlen']}"/>
                                 <s:convertEnum/>
                               </h:selectOneMenu>
                               
                               <h:outputLabel for="verpflegtArt" value="#{messages['cj.jsp.inserieren.verpflegungsart']}"/>
                               <h:selectManyListbox size="5" value="#{feWo.verpflegungsArtList}" id="verpflegtArt" label="#{messages['cj.jsp.inserieren.verpflegungsart']}" required="true">
                                      <s:selectItems var="verpflegungsArt" value="#{enumLists.verpflegungsArtList}" label="#{messages[verpflegungsArt.messageCode]}" noSelectionLabel="#{messages['cj.jsp.listbox.bittewaehlen']}"/>
                                   <s:convertEnum/>
                               </h:selectManyListbox>
                               
                          </h:panelGrid>
                     </fieldset>
                </rich:panel>
                <div class="actionButtons">
                    <h:commandButton id="save" value="#{messages['cj.jsp.button.save']}" action="#{inserierenWizardAction.save}"/>
                    <h:commandButton id="cancel" value="#{messages['cj.jsp.button.cancel']}" action="cancel"/>
               </div>
           </s:validateAll>
          </h:form>
          
          <ui:include src="/layout/messages.xhtml"/>
      </ui:define>



      Page chooseRegion:


      <ui:define name="body">
           <f:view>
          <h:form id="frmChooseParent" styleClass="niceform">
              <rich:panel>
                  <f:facet name="header"><h:outputText value="#{messages['cj.jsp.inserieren.region.chooser.headline']}"/></f:facet>
                     <ui:repeat value="#{parentRegionList}" var="parentRegion">
                            <h:commandLink id="switchToParent" value="#{parentRegion.name}" action="#{inserierenWizardAction.switchRegion(parentRegion)}"/><rich:spacer width="3px;" height="2px"/>|<rich:spacer width="3px;" height="2px"/>
                     </ui:repeat>
                     <h:outputText value="#{selectedRegion.name}"/>
                     <rich:spacer/>
                     <p/>
                      <fieldset>
                         <legend><h:outputText value="#{messages['cj.jsp.inserieren.unterregionen']} #{selectedRegion.name}" /></legend>
                          <s:div rendered="#{selectedRegion.childElements.size > 0}" > 
                               <ui:repeat value="#{childRegionList}" var="childRegion">
                                      <h:commandLink id="switchToChild" value="#{childRegion.name}" action="#{inserierenWizardAction.switchRegion(childRegion)}"/>
                                      <br/>
                               </ui:repeat>
                          </s:div>
                          <s:div rendered="#{selectedRegion.childElements.size == 0}" >
                               <h:outputText value="#{messages['cj.jsp.inserieren.region.chooser.keineunterregionen']}"/>                     
                          </s:div>
                     </fieldset>
                </rich:panel>
                 <h:commandButton id="submit" value="#{messages['cj.jsp.button.uebernehmen']}" action="#{inserierenWizardAction.selectRegion(selectedRegion)}"/>
                 <h:commandButton id="cancel" value="#{messages['cj.jsp.button.cancel']}" action="cancel"/>
                
           </h:form>
          <ui:include src="/layout/messages.xhtml"/>
          </f:view>
      </ui:define>