10 Replies Latest reply: Mar 28, 2013 3:34 AM by Steffen Prendke RSS

    Reading the current selection, data is empty

    Steffen Prendke

      Hey,

      I want to have access to the selected values: I want to do this with an click-Event: Go through every element, look at the Current Selection Box and read the data in there.

       

      var doc;

      function getObjectList() {

          doc = Qv.GetCurrentDocument();

          doc.GetAllObjects(function (objects) {

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

                    var obj = objects[i];

                    var id = obj.id;

                    var caption = obj.caption;

                    var type = obj.type;

                    var my = obj.my;

                  console.log("[obj:" + obj + " id:" + id + " caption:" + caption + " type:" + type + " my: " + my + "]");

                  if (type === "Statusbox") {

                      var object = doc.GetObject(id);

                      //object data is empty, why is this empty, I have some data in there

                      var dataContent = objekt.Data.Rows;

                     

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

                              var content = dataContent[i];

                              console.log("Name: " + content[0].text + " Value: " + content[2].text + " Optional: " + content[1].text);

                          }

                 }

             }

          }

          )};

      Do you have some idea?