Qlik Community

QlikView Deployment

Discussion Board for collaboration related to QlikView Deployment.

Not applicable

Javascript API - Set Selection Texts Listbox

Hello I'm creating a web application with QlikView Workbench 10 and Visual Studio 2010. I would like to set a selection using a simple button click event.

According to the SDK documentation, I've written:

function ApplySelection() {
var lb = qva.GetQvObject("LB01", function(){});
var arrRecords = ["GE", "MI"];
lb.QvaPublic.Data.SelectTexts(arrRecords);
}


but QvaPublic is null.

I've also tried:

lb.Data.SelectTexts(arrRecords);

but again Data is null.

What I'm doing wrong?


Thanks for your help.

1 Reply
Not applicable

Javascript API - Set Selection Texts Listbox

Check the attached example, Regards.

<html >

<head runat="server">

<title></title>

</head>

<script type="text/jscript">

OnUpdate = function() {

}

var MyObjectLB;

Init = function() {

MyObjectLB = qva.GetQvObject("LB01", OnUpdate);

}

Qva.BodyOnLoadFunctionNames.push("Init");

OnClickSelect = function() {

MyObjectLB.QvaPublic.Data.SelectTexts("GE", "MI");

}

</script>

<body>

<form id="form1" runat="server">

<qww:QvObject ID="QvObject1" runat="server" ObjectID="LB01"

ObjectType="List Box" QlikViewDocument="Films (Local)"

QvAjaxZfcPath="http://localhost/QvAjaxZfc/" />

<div>

<input id="Button1" type="button" value="button" onclick="OnClickSelect()" /></div>

</form>

</body>

</html>