3 Replies Latest reply on Oct 9, 2009 10:18 AM by Martin Jamszolik

    multiple request corrupt data model

    Martin Jamszolik Newbie

      Technology :
      RichFaces 3.3.1 and 3.3.2
      Spring Webflow 2.0.8
      MyFaces 1.2.7
      jboss el 2.0.1
      tomcat5.5


      Usecase : a main page contains <rich:tabPanel> with 6 <rich:tab> tags. switching is set as ajax. Every tab contains about 20~30 input fields which get submitted and applied to data model on tab switch.

      The problem is that if i start clicking on the tabs consecutively and cause multiple requests before previous request finishes, my data model get's corrupted with null values.

      I would like to understand why this is occurring and how to stop it.

      Quick overview under the hood :
      We store a bean (AbstractRisk) object at the start of the flow in a flow scope and update the bean as we navigate tabs and input data. on each tab change we save the bean, run some business validations, and perform business rating for insurance.
      We do use <a4j:queue name="tabQueue" > tag surrounding the tab panel.



      Here is a link to a picture of our application:
      http://picasaweb.google.com/lh/photo/VpGc3TykC3qy-5oRd1p6Zw?feat=directlink

        • 1. Re: multiple request corrupt data model
          Ilya Shaikovsky Master

          you just using queue component in wrong way.

          add just <a4j:queue /> to the form or view. read more at dev guide.

          • 2. Re: multiple request corrupt data model
            Martin Jamszolik Newbie

            This is how we setup the queue in our code :

            <a4j:queue name="tabQueue" requestDelay="100" ignoreDupResponses="true">
             <a4j:form id="q2iForm" >
             <rich:tabPanel id="tabManager" switchType="ajax" selectedTab="#{tabViewState.selectedTab}" >
             <rich:tab label="General" id="general" action="general" eventsQueue="tabQueue" similarityGroupingId="1">
             <ui:include src="general/general-tab.xhtml"/>
             </rich:tab>
            
             <rich:tab label="Coverage" id="coverage" action="coverage" eventsQueue="tabQueue" similarityGroupingId="1">
             <ui:include src="coverage/coverage-tab.xhtml"/>
             </rich:tab>
            
             <rich:tab label="Structure" id="structure" action="structure" eventsQueue="tabQueue" similarityGroupingId="1">
             <ui:include src="structure/structure-tab.xhtml"/>
             </rich:tab>
            
             <rich:tab label="Underwriting" id="underwriting" action="underwriting" eventsQueue="tabQueue" similarityGroupingId="1">
             <ui:include src="underwriting/underwriting-tab.xhtml"/>
             </rich:tab>
            
             <rich:tab label="Insured" id="insured" action="insured" eventsQueue="tabQueue" similarityGroupingId="1">
             <ui:include src="insured/insured-tab.xhtml"/>
             </rich:tab>
            
             <rich:tab label="Payment" id="payment" action="payment" eventsQueue="tabQueue" similarityGroupingId="1">
             <ui:include src="payment/payment-tab.xhtml"/>
             </rich:tab>
            
             </rich:tabPanel>
             <ui:include src="../close-application.xhtml"/>
             </a4j:form>
            </a4j:queue>

            Is this code wrong?
            I will review the queue dev guide one more time.

            • 3. Re: multiple request corrupt data model
              Martin Jamszolik Newbie

              Thank you very much you really put me back on the right track.

              i changed the queue to this

              <a4j:form id="q2iForm" >
               <a4j:queue requestDelay="100" ignoreDupResponses="true" sizeExceededBehavior="dropNew" size="1" />
              
              


              That really gave me the desired effect.
              Thanks again