7 Replies Latest reply: Feb 23, 2012 8:51 AM by Yusuf Malubhai RSS

    listbox and webpage viewer control

      I have to create simple application which uses web page viewer (custom object)

       

      and I have one sheet object and on that i have "sales compass.qvw"(a demo came with qlikview) and webpage viewer object in which I have url which take querystring as parameter and do some work

       

      i am using this code

      var text;

              var myobj1 = this.GetQvObject("LB02", function () {

                  text = myobj1.QvaPublic.Data.GetSelected();

                  alert("the text value is: " + text);

              });

       

       

      LB02 is my list box

       

      i am getting this msg in alert box the text value is:object Object

       

      does someone knows the solution

        • Re: listbox and webpage viewer control
          Jérémy George

          Try that instead of your alert(...):

           

          var s = "";

          for(var i=0; i<text.length; i++) {

               s += text[i] + "\n";

          }

          alert(s);

            • listbox and webpage viewer control

              thanks for quick reply and your time

               

              I tried what you said like this

              var text;

                      var s = "";

               

                      var myobj1 = this.GetQvObject("LB02", function () {

               

                          text = myobj1.QvaPublic.Data.GetSelected();

               

                          for (var i = 0; i < text.length; i++) {

                              s += text[i] + "\n";

                          }

                          alert("the text value is: " + s);

               

                      });

              but got the same msg in alert box the text value is:object Object

               

              I also tried

               

               

              var text;

                      var s = "";

               

                      var myobj1 = this.GetQvObject("LB02", function () {

               

                          text = myobj1.QvaPublic.Data.GetSelected();

               

                          for (var i = 0; i < text.length; i++) {

                              s += text[i] + "\n";

                          }

                          alert("the text value is: " + s.name); // .name and also tried s.value

               

                      });

              i tried this also

                  alert("the text value is: " + s.name);

                   alert("the text value is: " + s.value);

               

              but got this msg in alert box the text value is:undefined

               

              but one thing I am able to read know with you help is size of selection

               

              alert("the text value is: " + text.length);

               

              do you have any other suggestions

               

              thanks again