4 Replies Latest reply on Oct 26, 2010 2:16 PM by fobos

    reRender + OpenLayers + multiple request problem

    fobos

      Hi all,

       

      I have a page using richfaces and OpenLayers to display maps on my application. I have problems with extensive use of map or only for use a map together richfaces.

       

      In my page have three extendedDataTable updated by a <a4j:poll> component with interval of 5minutes and a Map using OpenLayers in a DIV on left side of page, this maps is like a Google Maps, user can pan,zoom,click,show/hide layers of map...

       

      The page runs fine for a time, all three tables refreshs without problems, map open ok,  navigate using pan, zoom, hide/show layers...

       

      My problem is after a time using a map i stop all operations on map and whole page, i´m only watching page with refresh in extendedDataTable´s, the page runs fine for a time, but suddenly the page broken, only one of three extendDataTable is rendered without styles and the rest of page disapears.

       

      Analyzing requests and source of pages, the source of page when error occours is correct to update one extendedDataTable is like a response to reRender only one dataTable, but have only a content for one extendedDataTable and rest of page disapears causing page to broken.

       

      Has a problem to reRender multiple extendedDataTable in same page ??

      Why all code of page is lost and only result of a partial region replace all content of page, instead of only a region defined in reRender ??

       

      This error also occurs with extensive use of map, map generate a large number of requests to get images to render map and when map is loading and poll do request data to update dataTables the error occour.

       

      Concurrent requests of OpenLayers and RichFaces can cause this problem ??

       

      I try use only one poll or three, configure many type of queues, configure parse of TIDY and NEKO, LoadStrategy.... nothing solve my problem.

       

      This a peace of my code to explain:

       

       

      <a:region>
      This is the polls, i try use only one poll and the error persist.
      
      I try reRender direct on extendedDataTable and in a outputpanel with dataTable but the error persist.
      
      <a:region>
                <h:form>
                     <a:poll id="pollTurmas" reRender="turmasTable"
                          action="#{MB.carregaTurmas}"
                          enabled="true"
                          interval="${initParam.refreshTime}" eventsQueue="gestor"
                          limitToList="true" bypassUpdates="true" 
                          immediate="true" ajaxSingle="true"/>
                </h:form>
           </a:region>
           <a:region>
                <h:form>
                     <a:poll id="pollServicos" reRender="servicosTable"
                          action="#{gestorMB.carregaServicos}"
                          enabled="#{not empty gestorMB.filter}"
                          interval="${initParam.refreshTime}" eventsQueue="gestor" 
                          limitToList="true" bypassUpdates="true"
                          immediate="true" ajaxSingle="true"/>
                </h:form>
           </a:region>
           <a:region>
                <h:form>
                     <a:poll id="pollAlarmes" reRender="tableAlarmes"
                          action="#{gestorMB.carregaAlarmes}"
                          enabled="#{not empty gestorMB.filter}"
                          interval="${initParam.refreshTime}" eventsQueue="gestor"
                          limitToList="true" bypassUpdates="true"
                          immediate="true" ajaxSingle="true"/>
                </h:form>
           </a:region>
      <h:form>
      <a:poll id="pollTurmas" reRender="turmasTable"
      action="#{gestorMB.carregaTurmas}"
      enabled="true"
      My three extendedDataTable:
      a sample of a outputpanel where the datatable is:
      
       
      
      <a:outputPanel  layout="none" id="listServicos"><a:outputPanel/>
      
      
      <rich:extendedDataTable     var="servico"     id="turmasTable"     
      value="#{gestorMB.listTurmas}" 
      rendered="#{not empty gestorMB.listTurmas}"
      height="300px" enableContextMenu="false" >
      </rich:extendedDataTable>
      
      
      <rich:extendedDataTable     var="servico"     id="servicosTable"     
      value="#{gestorMB.listServicos}"
      rendered="#{not empty gestorMB.listServicos}"
      height="300px" enableContextMenu="false" >
      <rich:extendedDataTable>
      
      <rich:extendedDataTable     var="servico"     id="alarmesTable"     
      value="#{gestorMB.listAlarmes}" 
      rendered="#{not empty gestorMB.listAlarmes}"
      height="300px" enableContextMenu="false" >
      <rich:extendedDataTable>
      
      

       

      I using richfaces 3.3.3Final

      Facelets 1.1.15

      jsf 1.2 sun

       

      Any help or tip is apreciated.

      This problem has already months that I can´t solve :-(

        • 1. Re: reRender + OpenLayers + multiple request problem
          ilya_shaikovsky

          try to use layout = block for output panel around the conditionally rendered table and update the outputPanel instead of table itself.

           

          It's difficult to say more for complex case - if not helps - please try to create sample for investigation.

          • 2. Re: reRender + OpenLayers + multiple request problem
            fobos

            I change layout of painels to block and testing now.

            Post results here soon.

             

            Thanks a lot for hint.

            • 3. Re: reRender + OpenLayers + multiple request problem
              fobos

              No success, i change layout of painels to block without success, error persist.

              I suspect this can be a error with filters like NEKO, TIDY, DEFAULT or in response ajax generated after many ajax requests.

              I try use NONE,NEKO and TIDY in filter but error persist.

              I dont know what to try now.

              • 4. Re: reRender + OpenLayers + multiple request problem
                fobos

                One new information of my problem.

                 

                When exists many request´s of images to server waiting server response and poll send a request to update table the error occour.

                 

                Occour a page refresh complete like a new request, its like XmlHttpRequest transform in a simple HTTP request like a link or redirect, the content returned is only for one table on page, when browser render this is only a table without whole of page and styles and so on.

                In firefox with firebug active when error occour is like a link to another page without errors. The page render ok, HTML has no erros parse is ok but instead of rerender only a region of a table in page this rerender render this block only for all page.

                 

                Any suggestions ?

                Thanks.