Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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
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.-
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.-