Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
comunico
Partner - Contributor III
Partner - Contributor III

Unable to use Qva.BodyOnLoadFunctionNames.push

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

1 Solution

Accepted Solutions
diegofcaivano
Partner - Creator
Partner - Creator

Hi.

It took me several days till I found the answer. There's a mistake in the Java API documentation, regarding the use of quotes in the function parameter.

Try Qva.BodyOnLoadFunctionNames.push(init()) and it should work. It did for me.

Diego.-

View solution in original post

1 Reply
diegofcaivano
Partner - Creator
Partner - Creator

Hi.

It took me several days till I found the answer. There's a mistake in the Java API documentation, regarding the use of quotes in the function parameter.

Try Qva.BodyOnLoadFunctionNames.push(init()) and it should work. It did for me.

Diego.-