1 Reply Latest reply: Mar 19, 2012 9:24 AM by Diego Fernando Caivano RSS

    Unable to use Qva.BodyOnLoadFunctionNames.push

    Luca Marasi

      Hi,

       

      I tried without success to use Qva.BodyOnLoadFunctionNames.push in an extension object.

      Anyone could tell what am i doing wrong? I tried by putting in different positions but no success.

       

      Below an example with the WebPageViewer extension object.

       

      function init() {
      
           alert("init!");
      
           var myListBoxObject = this.GetQvObject("LB10", function(){});
           alert(myListBoxObject.Name + " " + myListBoxObject.mode);
      }
      
      Qva.BodyOnLoadFunctionNames.push('init');
      
      
      Qva.AddExtension('QlikView/Examples/WebPageViewer', function() { 
      
      
           if(!this.divcreated)
           {
      
                var el = document.createElement("iframe");
                          el.setAttribute('id', 'ifrm');
                          el.frameBorder = 0; //optional
                          el.style.width = this.GetWidth() + "px";
                          el.style.height = this.GetHeight() + "px";
                          this.Element.appendChild(el);
                          el.setAttribute('src', this.Layout.Text0.text);
                          this.framecreated = true;
           }
           else
           {
      
                          var ifrm = document.getElementById("ifrm");
                          ifrm.style.width = this.GetWidth();
                          ifrm.style.height = this.GetHeight();
                          ifrm.setAttribute('src', this.Layout.Text0.text);
           }
      
      
      });
      
      

       

      Many thanks