4 Replies Latest reply: Aug 28, 2007 1:26 PM by 476328 RSS

    Suggestion: htmldb_html_elements.js htmldb_PPR_Report_Page

    476328
      The javascript file htmldb_html_elements.js contains the following function definition:
      /* Begin PPR Reports */
      function html_PPR_Report_Page (pThis,pRid,pURL,pHeader,pFooter){
          var l_pRid = html_CleanRegionId(pRid);
          document.body.style.cursor = 'wait';
          var l_URL = pURL;
          var start = l_URL.indexOf('?');
          l_URL = l_URL.substring(start + 1);
          l_URL = html_replace(l_URL,'pg_R_','FLOW_PPR_OUTPUT_'+l_pRid+'_pg_R_');
          l_URL = html_replace(l_URL,'fsp_sort_','FLOW_PPR_OUTPUT_'+l_pRid+'_fsp_sort_');
          var http = new htmldb_Get('report'+ l_pRid,null,null,null,null,'f',l_URL);
          http.get(null,'<htmldb:'+l_pRid+'>','</htmldb:'+l_pRid+'>');
      
          if(pHeader){$x('report'+ l_pRid).innerHTML =  pHeader + $x('report'+ l_pRid).innerHTML}
          if(pFooter){$x('report'+ l_pRid).innerHTML += pFooter;}
          document.body.style.cursor = '';
          init_htmlPPRReport(l_pRid);
          http = null;
          return;
      }
      This does it's job, but I've noticed that when an object uses both pHeader and pFooter the item "jumps" as the elements are appended to the page in IE.

      Might I suggest altering the lines
      var http = new htmldb_Get('report'+ l_pRid,null,null,null,null,'f',l_URL);
      http.get(null,'<htmldb:'+l_pRid+'>','</htmldb:'+l_pRid+'>');
      
      if(pHeader){$x('report'+ l_pRid).innerHTML =  pHeader + $x('report'+ l_pRid).innerHTML}
      if(pFooter){$x('report'+ l_pRid).innerHTML += pFooter;}
      to something like
      var http = new htmldb_Get(null,null,null,null,null,'f',l_URL);
      var returnText = http.get(null,'<htmldb:'+l_pRid+'>','</htmldb:'+l_pRid+'>');
      if(pHeader){ returnText =  pHeader + returnText;}
      if(pFooter){ returnText += pFooter;}
      $x('report'+ l_pRid).innerHTML = returnText;
      This way the innerHTML component is only updated once and we don't see a "jump" as the text is appended to the innerHTML.

      What do you think?

      Thanks,
      Joe