1 Reply Latest reply: Dec 6, 2010 11:59 AM by Corrado Lorefice RSS

    Javascript API - Set Selection Texts Listbox

    Marco Brugna

      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.

        • 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>