Facility Control

 View Only
Expand all | Collapse all

XML link in paramteters

CLAUDE Blank

CLAUDE Blank03-16-2017 19:18

Dennis Blank

Dennis Blank05-10-2017 13:33

  • 1.  XML link in paramteters

    Posted 03-16-2017 07:58

    Hi Everyone I have created a user interface and I want to link an XML File.

    I would like to write an ID in the right column and automatically retreive the linked information in the right column.

    How can I do that ?




  • 2.  RE: XML link in paramteters

    Posted 03-16-2017 13:49

    Here is an example that demonstrates the concept of what you're trying to do:

    <abs contexttype="opengear" style="">
       <meta>
          <params>
             <param access="1" maxlength="0" name="Info 1" oid="params.info1" type="STRING" value="ID NOT FOUND" widget="default"/>
             <param access="1" maxlength="0" name="Info 2" oid="params.info2" type="STRING" value="ID NOT FOUND" widget="default"/>
             <param access="1" maxlength="0" name="Info 3" oid="params.info3" type="STRING" value="ID NOT FOUND" widget="default"/>
             <param access="1" maxlength="0" name="ID 1" oid="params.id1" type="STRING" value="0" widget="default"/>
             <param access="1" maxlength="0" name="ID 2" oid="params.id2" type="STRING" value="0" widget="default"/>
             <param access="1" maxlength="0" name="ID 3" oid="params.id3" type="STRING" value="0" widget="default"/>
          </params>
       </meta>
       <meta>
          <api immediate="true">//CALLING THIS WHENEVER YOU WANT TO RELOAD THE XML
    function initXML()
    {
       //REPLACE THIS WITH A CALL TO PARSE YOUR ACTUAL XML DOCUMENT
       var xml = ogscript.parseXML('&lt;team name="NH2017"&gt;&lt;squad&gt;&lt;player ID="1" name="PLAYER NAME 1" owner="PLAYER OWNER 1"/&gt;&lt;player ID="2" name="PLAYER NAME 2" owner="PLAYER OWNER 2"/&gt;&lt;/squad&gt;&lt;/team&gt;');
       ogscript.putObject("XMLDoc", xml);
    }
    
    //PROVIDE THE OID OF THE PARAMETER WITH THE "ID" AND THE OID OF THE PARAMETER WHOSE VALUE YOU'D LIKE TO FILL
    function updateInfo(idOID, infoOID)
    {
       var xmlDoc = ogscript.getObject("XMLDoc");  //TRY TO GET THE XML DOCUMENT
       if (xmlDoc == null)
       {
          params.setValue(infoOID, 0, "XML NOT LOADED"); 
       }
    
       var id = params.getValue(idOID, 0); //GET THE ID
       var nodeList = ogscript.runXPath("/team/squad/player[@ID='" + id + "']", xmlDoc);  //THIS IS AN XPATH COMMAND TO FIND PLAYERS WITH THE CORRECT ID LEARN MORE ABOUT XPATH AT https://www.w3schools.com/xml/xpath_intro.asp
       if (nodeList != null &amp;&amp; nodeList.getLength() &gt; 0)  //IF OUR XPATH COMMAND RETURNED RESULTS
       {
          var node = nodeList.item(0);
          params.setValue(infoOID, 0, node.getAttribute("name") + " " + node.getAttribute("owner"));  //FILL THE VALUE
       }
       else
       {
          params.setValue(infoOID, 0, "ID NOT FOUND"); 
       }
    }
    
    initXML(); //RELOAD THE XML AT THE START TO MAKE SURE IT IS IN THE SYSTEM</api>
       </meta>
       <table height="340" left="19" top="21" width="300">
          <tr>
             <param colspan="1" expand="true" fill="both" insets="2,2,2,2" oid="params.id1" rowspan="1" runtasksonload="true" showlabel="false" weightx="1.0" weighty="1.0">
                <task tasktype="ogscript">updateInfo('params.id1', 'params.info1');
    </task>
             </param>
             <param colspan="1" expand="true" fill="both" insets="2,2,2,2" oid="params.info1" rowspan="1" showlabel="false" weightx="1.0" weighty="1.0"/>
          </tr>
          <tr>
             <param colspan="1" expand="true" fill="both" insets="2,2,2,2" oid="params.id2" rowspan="1" runtasksonload="true" showlabel="false" weightx="1.0" weighty="1.0">
                <task tasktype="ogscript">updateInfo('params.id2', 'params.info2');</task>
             </param>
             <param colspan="1" expand="true" fill="both" insets="2,2,2,2" oid="params.info2" rowspan="1" showlabel="false" weightx="1.0" weighty="1.0"/>
          </tr>
          <tr>
             <dropspot colspan="1" fill="both" insets="2,2,2,2" rowspan="1" weightx="1.0" weighty="1.0"/>
             <dropspot colspan="1" fill="both" insets="2,2,2,2" rowspan="1" weightx="1.0" weighty="1.0"/>
          </tr>
          <tr>
             <param colspan="1" expand="true" fill="both" insets="2,2,2,2" oid="params.id3" rowspan="1" runtasksonload="true" showlabel="false" weightx="1.0" weighty="1.0">
                <task tasktype="ogscript">updateInfo('params.id3', 'params.info3');</task>
             </param>
             <param colspan="1" expand="true" fill="both" insets="2,2,2,2" oid="params.info3" rowspan="1" showlabel="false" weightx="1.0" weighty="1.0"/>
          </tr>
          <tr>
             <dropspot colspan="1" fill="both" insets="2,2,2,2" rowspan="1" weightx="1.0" weighty="1.0"/>
             <dropspot colspan="1" fill="both" insets="2,2,2,2" rowspan="1" weightx="1.0" weighty="1.0"/>
          </tr>
          <tr>
             <dropspot colspan="1" fill="both" insets="2,2,2,2" rowspan="1" weightx="1.0" weighty="1.0"/>
             <dropspot colspan="1" fill="both" insets="2,2,2,2" rowspan="1" weightx="1.0" weighty="1.0"/>
          </tr>
          <tr>
             <dropspot colspan="1" fill="both" insets="2,2,2,2" rowspan="1" weightx="1.0" weighty="1.0"/>
             <dropspot colspan="1" fill="both" insets="2,2,2,2" rowspan="1" weightx="1.0" weighty="1.0"/>
          </tr>
          <tr>
             <dropspot colspan="1" fill="both" insets="2,2,2,2" rowspan="1" weightx="1.0" weighty="1.0"/>
             <dropspot colspan="1" fill="both" insets="2,2,2,2" rowspan="1" weightx="1.0" weighty="1.0"/>
          </tr>
          <tr>
             <dropspot colspan="1" fill="both" insets="2,2,2,2" rowspan="1" weightx="1.0" weighty="1.0"/>
             <dropspot colspan="1" fill="both" insets="2,2,2,2" rowspan="1" weightx="1.0" weighty="1.0"/>
          </tr>
       </table>
    </abs>

     

    The important/functional part of this is in the API block - we just call the functions defined in this API block whenever we want to load the value into our "info" parameter

    //CALLING THIS WHENEVER YOU WANT TO RELOAD THE XML
    function initXML()
    {
       //REPLACE THIS WITH A CALL TO PARSE YOUR ACTUAL XML DOCUMENT
       var xml = ogscript.parseXML('<team name="NH2017"><squad><player ID="1" name="PLAYER NAME 1" owner="PLAYER OWNER 1"/><player ID="2" name="PLAYER NAME 2" owner="PLAYER OWNER 2"/></squad></team>');
       ogscript.putObject("XMLDoc", xml);
    }
    
    //PROVIDE THE OID OF THE PARAMETER WITH THE "ID" AND THE OID OF THE PARAMETER WHOSE VALUE YOU'D LIKE TO FILL
    function updateInfo(idOID, infoOID)
    {
       var xmlDoc = ogscript.getObject("XMLDoc");  //TRY TO GET THE XML DOCUMENT
       if (xmlDoc == null)
       {
          params.setValue(infoOID, 0, "XML NOT LOADED"); 
       }
    
       var id = params.getValue(idOID, 0); //GET THE ID
       var nodeList = ogscript.runXPath("/team/squad/player[@ID='" + id + "']", xmlDoc);  //THIS IS AN XPATH COMMAND TO FIND PLAYERS WITH THE CORRECT ID LEARN MORE ABOUT XPATH AT https://www.w3schools.com/xml/xpath_intro.asp
       if (nodeList != null && nodeList.getLength() > 0)  //IF OUR XPATH COMMAND RETURNED RESULTS
       {
          var node = nodeList.item(0);
          params.setValue(infoOID, 0, node.getAttribute("name") + " " + node.getAttribute("owner"));  //FILL THE VALUE
       }
       else
       {
          params.setValue(infoOID, 0, "ID NOT FOUND"); 
       }
    }
    
    initXML(); //RELOAD THE XML AT THE START TO MAKE SURE IT IS IN THE SYSTEM

    #DashBoard


  • 3.  RE: XML link in paramteters

    Posted 03-16-2017 14:25
    OK If I understand

    In your exemple you have fill the player information in the code. It is not a xml file reading ?

    #DashBoard


  • 4.  RE: XML link in paramteters

    Posted 03-16-2017 14:27
    You wrote "TRY TO GET THE XML DOCUMENT" I suppose I have to create a "File Browser" to load the correct file ?
    #DashBoard


  • 5.  RE: XML link in paramteters

    Posted 03-16-2017 14:39
    How you pass the file name is up to you. What you would do is call ogscript.parseXML(FILE_PATH); instead of embedding the XML directly in the document like I did (I did it that way since I didn't have your XML file).

    If your XML file is in the same folder as your Custom Panel, it is as easy as ogscript.parseXML('MY_XML_FILE.xml');

    If your XML file is elsewhere on your computer, it would be:
    ogscript.praseXML('file:/c:/folder/sub_folder/MY_XML_FILE.xml');

    If your XML file is on a web server somewhere, it would be:
    ogscript.parseXML('http://host/path/MY_XML_FILE.xml');
    #DashBoard


  • 6.  RE: XML link in paramteters

    Posted 03-16-2017 19:05

    Hi James;

    I have replace your XML suite by my XML File (place it in the same folder than my pannel). It doesn't work . Here is the code.

    An Idea ?

    <abs contexttype="opengear">
       <meta>
          <params>
             <param access="1" maxlength="0" name="Info 1" oid="params.info1" type="STRING" value="ID NOT FOUND" widget="default"/>
             <param access="1" maxlength="0" name="Info 2" oid="params.info2" type="STRING" value="ID NOT FOUND" widget="default"/>
             <param access="1" maxlength="0" name="Info 3" oid="params.info3" type="STRING" value="ID NOT FOUND" widget="default"/>
             <param access="1" maxlength="0" name="ID 1" oid="params.id1" type="STRING" value="1" widget="default"/>
             <param access="1" maxlength="0" name="ID 2" oid="params.id2" type="STRING" value="0" widget="default"/>
             <param access="1" maxlength="0" name="ID 3" oid="params.id3" type="STRING" value="1" widget="default"/>
          </params>
       </meta>
       <meta>
          <api immediate="true">//CALLING THIS WHENEVER YOU WANT TO RELOAD THE XML
    function initXML()
    {
       //REPLACE THIS WITH A CALL TO PARSE YOUR ACTUAL XML DOCUMENT
       var xml = ogscript.parseXML(NH2017.xml);
       ogscript.putObject("XMLDoc", xml);
    }
    
    //PROVIDE THE OID OF THE PARAMETER WITH THE "ID" AND THE OID OF THE PARAMETER WHOSE VALUE YOU'D LIKE TO FILL
    function updateInfo(idOID, infoOID)
    {
       var xmlDoc = ogscript.getObject("XMLDoc");  //TRY TO GET THE XML DOCUMENT
       if (xmlDoc == null)
       {
          params.setValue(infoOID, 0, "XML NOT LOADED");
       }
    
       var id = params.getValue(idOID, 0); //GET THE ID
       var nodeList = ogscript.runXPath("/team/squad/player[@ID='" + id + "']", xmlDoc);  //THIS IS AN XPATH COMMAND TO FIND PLAYERS WITH THE CORRECT ID LEARN MORE ABOUT XPATH AT https://www.w3schools.com/xml/xpath_intro.asp
       if (nodeList != null &amp;&amp; nodeList.getLength() &gt; 0)  //IF OUR XPATH COMMAND RETURNED RESULTS
       {
          var node = nodeList.item(0);
          params.setValue(infoOID, 0, node.getAttribute("name") + " " + node.getAttribute("owner"));  //FILL THE VALUE
       }
       else
       {
          params.setValue(infoOID, 0, "ID NOT FOUND");
       }
    }
    
    initXML(); //RELOAD THE XML AT THE START TO MAKE SURE IT IS IN THE SYSTEM</api>
       </meta>
       <table height="340" left="19" top="21" width="300">
          <tr>
             <param colspan="1" expand="true" fill="both" insets="2,2,2,2" oid="params.id1" rowspan="1" runtasksonload="true" showlabel="false" weightx="1.0" weighty="1.0">
                <task tasktype="ogscript">updateInfo('params.id1', 'params.info1');</task>
             </param>
             <param colspan="1" expand="true" fill="both" insets="2,2,2,2" oid="params.info1" rowspan="1" showlabel="false" weightx="1.0" weighty="1.0"/>
          </tr>
          <tr>
             <param colspan="1" expand="true" fill="both" insets="2,2,2,2" oid="params.id2" rowspan="1" runtasksonload="true" showlabel="false" weightx="1.0" weighty="1.0">
                <task tasktype="ogscript">updateInfo('params.id2', 'params.info2');</task>
             </param>
             <param colspan="1" expand="true" fill="both" insets="2,2,2,2" oid="params.info2" rowspan="1" showlabel="false" weightx="1.0" weighty="1.0"/>
          </tr>
          <tr>
             <dropspot colspan="1" fill="both" insets="2,2,2,2" rowspan="1" weightx="1.0" weighty="1.0"/>
             <dropspot colspan="1" fill="both" insets="2,2,2,2" rowspan="1" weightx="1.0" weighty="1.0"/>
          </tr>
          <tr>
             <param colspan="1" expand="true" fill="both" insets="2,2,2,2" oid="params.id3" rowspan="1" runtasksonload="true" showlabel="false" weightx="1.0" weighty="1.0">
                <task tasktype="ogscript">updateInfo('params.id3', 'params.info3');</task>
             </param>
             <param colspan="1" expand="true" fill="both" insets="2,2,2,2" oid="params.info3" rowspan="1" showlabel="false" weightx="1.0" weighty="1.0"/>
          </tr>
          <tr>
             <dropspot colspan="1" fill="both" insets="2,2,2,2" rowspan="1" weightx="1.0" weighty="1.0"/>
             <dropspot colspan="1" fill="both" insets="2,2,2,2" rowspan="1" weightx="1.0" weighty="1.0"/>
          </tr>
          <tr>
             <dropspot colspan="1" fill="both" insets="2,2,2,2" rowspan="1" weightx="1.0" weighty="1.0"/>
             <dropspot colspan="1" fill="both" insets="2,2,2,2" rowspan="1" weightx="1.0" weighty="1.0"/>
          </tr>
          <tr>
             <dropspot colspan="1" fill="both" insets="2,2,2,2" rowspan="1" weightx="1.0" weighty="1.0"/>
             <dropspot colspan="1" fill="both" insets="2,2,2,2" rowspan="1" weightx="1.0" weighty="1.0"/>
          </tr>
          <tr>
             <dropspot colspan="1" fill="both" insets="2,2,2,2" rowspan="1" weightx="1.0" weighty="1.0"/>
             <dropspot colspan="1" fill="both" insets="2,2,2,2" rowspan="1" weightx="1.0" weighty="1.0"/>
          </tr>
          <tr>
             <dropspot colspan="1" fill="both" insets="2,2,2,2" rowspan="1" weightx="1.0" weighty="1.0"/>
             <dropspot colspan="1" fill="both" insets="2,2,2,2" rowspan="1" weightx="1.0" weighty="1.0"/>
          </tr>
       </table>
    </abs>
    

    #DashBoard


  • 7.  RE: XML link in paramteters

    Posted 03-16-2017 19:07
    I just add ' ' at my file name. But Doesn't Work

    var xml = ogscript.parseXML('NH2017.xml');

    #DashBoard


  • 8.  RE: XML link in paramteters

    Posted 03-16-2017 19:07
    Put quotes around your file name.
    #DashBoard


  • 9.  RE: XML link in paramteters

    Posted 03-16-2017 19:08
    Can you upload a copy of the XML file?
    #DashBoard


  • 10.  RE: XML link in paramteters

    Posted 03-16-2017 19:18
    Here is the file
    #DashBoard


  • 11.  RE: XML link in paramteters

    Posted 03-16-2017 19:22

    The problem is that your XML is not valid.
    Your file contains this:

    <player ID="2" name="CALINE " owner="BASTIN Daniel & TRIFFAUX Isabel"/>

    The problem is that "&" is reserved in XML so it needs to be escaped to:

    <player ID="2" name="CALINE " owner="BASTIN Daniel &amp; TRIFFAUX Isabel"


    #DashBoard


  • 12.  RE: XML link in paramteters

    Posted 03-16-2017 19:27
    Waouw . . It works. It still thing to do with this pannel. Retriev Name in one Cell and owner in a second one.

    Great thanks you save me a lot of time.
    #DashBoard


  • 13.  RE: XML link in paramteters

    Posted 03-16-2017 21:06

    I'm near the end but I block on one thing. I would like to display in even rows the name (of the ID) and in the odd rows the owner. I don't find in the code How could I do that.

    In fact this Template represente the 3 first of a category. For each winner i have to display the name in the first row ans the owner on the second one.
     
    <abs contexttype="opengear">
       <meta>
          <params>
             <param access="1" maxlength="0" name="Info 1" oid="params.info1" type="STRING" value="MAZEREEL Geert " widget="default"/>
             <param access="1" maxlength="0" name="Info 2" oid="params.info2" type="STRING" value="MAZEREEL Geert " widget="default"/>
             <param access="1" maxlength="0" name="Info 3" oid="params.info3" type="STRING" value="BOUTRY Emmanuel " widget="default"/>
             <param access="1" maxlength="0" name="Info 4" oid="params.info4" type="STRING" value="BOUTRY Emmanuel " widget="default"/>
             <param access="1" maxlength="0" name="Info 5" oid="params.info5" type="STRING" value="VAN DE VIJVER Tom " widget="default"/>
             <param access="1" maxlength="0" name="Info 6" oid="params.info6" type="STRING" value="VAN DE VIJVER Tom " widget="default"/>
             <param access="1" maxlength="0" name="ID 1" oid="params.id1" type="STRING" value="10" widget="default"/>
             <param access="1" maxlength="0" name="ID 2" oid="params.id2" type="STRING" value="10" widget="default"/>
             <param access="1" maxlength="0" name="ID 3" oid="params.id3" type="STRING" value="30" widget="default"/>
             <param access="1" maxlength="0" name="ID 4" oid="params.id4" type="STRING" value="30" widget="default"/>
             <param access="1" maxlength="0" name="ID 5" oid="params.id5" type="STRING" value="40" widget="default"/>
             <param access="1" maxlength="0" name="ID 6" oid="params.id6" type="STRING" value="40" widget="default"/>
             <param access="1" maxlength="0" name="IP_Server" oid="IP_Server" type="STRING" value="127.0.0.1" widget="text"/>
             <param access="1" maxlength="0" name="file" oid="file" type="STRING" value="bandelette5" widget="text"/>
             <param access="1" maxlength="0" name="templateData1" oid="templateData1" type="STRING" value="&quot;&lt;templateData&gt;" widget="text"/>
             <param access="1" maxlength="0" name="componentData1" oid="componentData1" type="STRING" value="&lt;componentData id=\&quot;" widget="text"/>
             <param access="1" maxlength="0" name="componentData2" oid="componentData2" type="STRING" value="\&quot;&gt;&lt;data id=\&quot;text\&quot; value=\&quot;" widget="text"/>
             <param access="1" maxlength="0" name="componentData3" oid="componentData3" type="STRING" value=" \&quot;/&gt;&lt;/componentData&gt;" widget="default"/>
             <param access="1" maxlength="0" name="templateData2" oid="templateData2" type="STRING" value="&lt;/templateData&gt;&quot;\r\n" widget="text"/>
          </params>
       </meta>
       <meta>
          <api immediate="true">//CALLING THIS WHENEVER YOU WANT TO RELOAD THE XML
    function initXML()
    {
       //REPLACE THIS WITH A CALL TO PARSE YOUR ACTUAL XML DOCUMENT
       var xml = ogscript.parseXML('NH2017.xml');
       ogscript.putObject("XMLDoc", xml);
    }
    
    //PROVIDE THE OID OF THE PARAMETER WITH THE "ID" AND THE OID OF THE PARAMETER WHOSE VALUE YOU'D LIKE TO FILL
    function updateInfo(idOID, infoOID)
    {
       var xmlDoc = ogscript.getObject("XMLDoc");  //TRY TO GET THE XML DOCUMENT
       if (xmlDoc == null)
       {
          params.setValue(infoOID, 0, "XML NOT LOADED");
       }
    
       var id = params.getValue(idOID, 0); //GET THE ID
       var nodeList = ogscript.runXPath("/team/squad/player[@ID='" + id + "']", xmlDoc);  //THIS IS AN XPATH COMMAND TO FIND PLAYERS WITH THE CORRECT ID LEARN MORE ABOUT XPATH AT https://www.w3schools.com/xml/xpath_intro.asp
       if (nodeList != null &amp;&amp; nodeList.getLength() &gt; 0)  //IF OUR XPATH COMMAND RETURNED RESULTS
       {
          var node = nodeList.item(0);
          params.setValue(infoOID, 0, node.getAttribute("name"));  //FILL THE VALUE
       }
       else
       {
          params.setValue(infoOID, 0, "ID NOT FOUND");
       }
    }
    
    initXML(); //RELOAD THE XML AT THE START TO MAKE SURE IT IS IN THE SYSTEM</api>
       </meta>
       <table height="381" left="61" top="32" width="1113">
          <tr>
             <param colspan="1" expand="true" fill="both" oid="params.id1" rowspan="1" runtasksonload="true" showlabel="false" weightx="1.0" weighty="1.0">
                <task tasktype="ogscript">updateInfo('params.id1', 'params.info1');</task>
             </param>
             <param colspan="1" editable="false" expand="true" fill="both" oid="params.info1" rowspan="1" showlabel="false" weightx="1.0" weighty="1.0"/>
             <dropspot colspan="1" fill="both" rowspan="1" weightx="1.0" weighty="1.0"/>
          </tr>
          <tr>
             <param colspan="1" expand="true" fill="both" oid="params.id2" rowspan="1" runtasksonload="true" showlabel="false" weightx="1.0" weighty="1.0">
                <task tasktype="ogscript">updateInfo('params.id2', 'params.info2');</task>
             </param>
             <param colspan="1" editable="false" expand="true" fill="both" oid="params.info2" rowspan="1" weightx="1.0" weighty="1.0" widget="text"/>
             <dropspot colspan="1" fill="both" rowspan="1" weightx="1.0" weighty="1.0"/>
          </tr>
          <tr>
             <dropspot colspan="1" fill="both" rowspan="1" weightx="1.0" weighty="1.0"/>
             <dropspot colspan="1" fill="both" rowspan="1" weightx="1.0" weighty="1.0"/>
             <dropspot colspan="1" fill="both" rowspan="1" weightx="1.0" weighty="1.0"/>
          </tr>
          <tr>
             <param colspan="1" expand="true" fill="both" oid="params.id3" rowspan="1" runtasksonload="true" showlabel="false" weightx="1.0" weighty="1.0">
                <task tasktype="ogscript">updateInfo('params.id3', 'params.info3');</task>
             </param>
             <param colspan="1" editable="false" expand="true" fill="both" oid="params.info3" rowspan="1" showlabel="false" weightx="1.0" weighty="1.0"/>
             <dropspot colspan="1" fill="both" rowspan="1" weightx="1.0" weighty="1.0"/>
          </tr>
          <tr>
             <param colspan="1" expand="true" fill="both" oid="params.id4" rowspan="1" runtasksonload="true" showlabel="false" weightx="1.0" weighty="1.0">
                <task tasktype="ogscript">updateInfo('params.id4', 'params.info4');</task>
             </param>
             <param colspan="1" editable="false" expand="true" fill="both" oid="params.info4" rowspan="1" weightx="1.0" weighty="1.0" widget="text"/>
             <dropspot colspan="1" fill="both" rowspan="1" weightx="1.0" weighty="1.0"/>
          </tr>
          <tr>
             <dropspot colspan="1" fill="both" rowspan="1" weightx="1.0" weighty="1.0"/>
             <dropspot colspan="1" fill="both" rowspan="1" weightx="1.0" weighty="1.0"/>
             <dropspot colspan="1" fill="both" rowspan="1" weightx="1.0" weighty="1.0"/>
          </tr>
          <tr>
             <param colspan="1" expand="true" fill="both" oid="params.id5" rowspan="1" runtasksonload="true" showlabel="false" weightx="1.0" weighty="1.0">
                <task tasktype="ogscript">updateInfo('params.id5', 'params.info5');</task>
             </param>
             <param colspan="1" editable="false" expand="true" fill="both" oid="params.info5" rowspan="1" showlabel="false" weightx="1.0" weighty="1.0"/>
             <dropspot colspan="1" fill="both" rowspan="1" weightx="1.0" weighty="1.0"/>
          </tr>
          <tr>
             <param colspan="1" expand="true" fill="both" oid="params.id6" rowspan="1" runtasksonload="true" showlabel="false" weightx="1.0" weighty="1.0">
                <task tasktype="ogscript">updateInfo('params.id6', 'params.info6');</task>
             </param>
             <param colspan="1" editable="false" expand="true" fill="both" oid="params.info6" rowspan="1" weightx="1.0" weighty="1.0" widget="text"/>
             <dropspot colspan="1" fill="both" rowspan="1" weightx="1.0" weighty="1.0"/>
          </tr>
       </table>
       <button buttontype="push" height="103" left="66" name="PLAY" top="467" width="405">
          <task tasktype="ogscript"/>
          <task tasktype="ogscript">var host = params.getValue('IP_Server', 0);
    var port = 5250;
    var cg = 'CG 1-20 ADD 1 '
    var file = params.getValue('file',0);
    var f0 = params.getValue('componentData1', 0) + 'f0' +params.getValue('componentData2',0) + params.getValue('params.info1',0) + params.getValue('componentData3',0);
    var f1 = params.getValue('componentData1', 0) + 'f1' +params.getValue('componentData2',0) + params.getValue('params.info2',0) + params.getValue('componentData3',0);
    var f2 = params.getValue('componentData1', 0) + 'f2' +params.getValue('componentData2',0) + params.getValue('params.info3',0) + params.getValue('componentData3',0);
    var f3 = params.getValue('componentData1', 0) + 'f3' +params.getValue('componentData2',0) + params.getValue('params.info4',0) + params.getValue('componentData3',0);
    var f4 = params.getValue('componentData1', 0) + 'f4' +params.getValue('componentData2',0) + params.getValue('params.info5',0) + params.getValue('componentData3',0);
    var f5 = params.getValue('componentData1', 0) + 'f5' +params.getValue('componentData2',0) + params.getValue('params.info6',0) + params.getValue('componentData3',0);
    
    var message =  cg + file + ' 1 ' + params.getValue('templateData1',0) + f0 + f1 + f2 + f3 + f4 + f5 + params.getValue('templateData2',0);
    
    
    rosstalk.sendMessage(host, port, message, null);</task>
       </button>
       <split height="228" left="38" orientation="vertical" top="626" width="1116">
          <abs weight="0.5"/>
          <abs>
             <param expand="true" height="34" left="776" name="IP_Server" oid="IP_Server" top="12" width="243"/>
             <param expand="true" height="34" left="776" name="File" oid="file" top="51" width="243"/>
             <param expand="true" height="34" left="31" oid="templateData1" top="15" width="204"/>
             <param expand="true" height="34" left="31" oid="componentData1" top="54" width="204"/>
             <param expand="true" height="34" left="31" oid="componentData2" top="93" width="204"/>
             <param expand="true" height="34" left="31" oid="componentData3" top="132" width="204"/>
             <param expand="true" height="34" left="31" oid="templateData2" top="171" width="204"/>
          </abs>
       </split>
    </abs>

    #DashBoard


  • 14.  RE: XML link in paramteters

    Posted 03-16-2017 21:07
    First left cell should display the name, second row should display the owner, third one should display the name, ... and so on
    #DashBoard


  • 15.  RE: XML link in paramteters

    Posted 03-16-2017 22:21

    I'm near the end but I block on one thing. I would like to display in even rows the name (of the ID) and in the odd rows the owner. I don't find in the code How could I do that.

    In fact this Template represente the 3 first of a category. For each winner i have to display the name in the first row ans the owner on the second one.

    <abs contexttype="opengear">
       <meta>
          <params>
             <param access="1" maxlength="0" name="Info 1" oid="params.info1" type="STRING" value="MAZEREEL Geert " widget="default"/>
             <param access="1" maxlength="0" name="Info 2" oid="params.info2" type="STRING" value="MAZEREEL Geert " widget="default"/>
             <param access="1" maxlength="0" name="Info 3" oid="params.info3" type="STRING" value="BOUTRY Emmanuel " widget="default"/>
             <param access="1" maxlength="0" name="Info 4" oid="params.info4" type="STRING" value="BOUTRY Emmanuel " widget="default"/>
             <param access="1" maxlength="0" name="Info 5" oid="params.info5" type="STRING" value="VAN DE VIJVER Tom " widget="default"/>
             <param access="1" maxlength="0" name="Info 6" oid="params.info6" type="STRING" value="VAN DE VIJVER Tom " widget="default"/>
             <param access="1" maxlength="0" name="ID 1" oid="params.id1" type="STRING" value="10" widget="default"/>
             <param access="1" maxlength="0" name="ID 2" oid="params.id2" type="STRING" value="10" widget="default"/>
             <param access="1" maxlength="0" name="ID 3" oid="params.id3" type="STRING" value="30" widget="default"/>
             <param access="1" maxlength="0" name="ID 4" oid="params.id4" type="STRING" value="30" widget="default"/>
             <param access="1" maxlength="0" name="ID 5" oid="params.id5" type="STRING" value="40" widget="default"/>
             <param access="1" maxlength="0" name="ID 6" oid="params.id6" type="STRING" value="40" widget="default"/>
             <param access="1" maxlength="0" name="IP_Server" oid="IP_Server" type="STRING" value="127.0.0.1" widget="text"/>
             <param access="1" maxlength="0" name="file" oid="file" type="STRING" value="bandelette5" widget="text"/>
             <param access="1" maxlength="0" name="templateData1" oid="templateData1" type="STRING" value="&quot;&lt;templateData&gt;" widget="text"/>
             <param access="1" maxlength="0" name="componentData1" oid="componentData1" type="STRING" value="&lt;componentData id=\&quot;" widget="text"/>
             <param access="1" maxlength="0" name="componentData2" oid="componentData2" type="STRING" value="\&quot;&gt;&lt;data id=\&quot;text\&quot; value=\&quot;" widget="text"/>
             <param access="1" maxlength="0" name="componentData3" oid="componentData3" type="STRING" value=" \&quot;/&gt;&lt;/componentData&gt;" widget="default"/>
             <param access="1" maxlength="0" name="templateData2" oid="templateData2" type="STRING" value="&lt;/templateData&gt;&quot;\r\n" widget="text"/>
          </params>
       </meta>
       <meta>
          <api immediate="true">//CALLING THIS WHENEVER YOU WANT TO RELOAD THE XML
    function initXML()
    {
       //REPLACE THIS WITH A CALL TO PARSE YOUR ACTUAL XML DOCUMENT
       var xml = ogscript.parseXML('NH2017.xml');
       ogscript.putObject("XMLDoc", xml);
    }
    
    //PROVIDE THE OID OF THE PARAMETER WITH THE "ID" AND THE OID OF THE PARAMETER WHOSE VALUE YOU'D LIKE TO FILL
    function updateInfo(idOID, infoOID)
    {
       var xmlDoc = ogscript.getObject("XMLDoc");  //TRY TO GET THE XML DOCUMENT
       if (xmlDoc == null)
       {
          params.setValue(infoOID, 0, "XML NOT LOADED");
       }
    
       var id = params.getValue(idOID, 0); //GET THE ID
       var nodeList = ogscript.runXPath("/team/squad/player[@ID='" + id + "']", xmlDoc);  //THIS IS AN XPATH COMMAND TO FIND PLAYERS WITH THE CORRECT ID LEARN MORE ABOUT XPATH AT https://www.w3schools.com/xml/xpath_intro.asp
       if (nodeList != null &amp;&amp; nodeList.getLength() &gt; 0)  //IF OUR XPATH COMMAND RETURNED RESULTS
       {
          var node = nodeList.item(0);
          params.setValue(infoOID, 0, node.getAttribute("name"));  //FILL THE VALUE
       }
       else
       {
          params.setValue(infoOID, 0, "ID NOT FOUND");
       }
    }
    
    initXML(); //RELOAD THE XML AT THE START TO MAKE SURE IT IS IN THE SYSTEM</api>
       </meta>
       <table height="381" left="61" top="32" width="1113">
          <tr>
             <param colspan="1" expand="true" fill="both" oid="params.id1" rowspan="1" runtasksonload="true" showlabel="false" weightx="1.0" weighty="1.0">
                <task tasktype="ogscript">updateInfo('params.id1', 'params.info1');</task>
             </param>
             <param colspan="1" editable="false" expand="true" fill="both" oid="params.info1" rowspan="1" showlabel="false" weightx="1.0" weighty="1.0"/>
             <dropspot colspan="1" fill="both" rowspan="1" weightx="1.0" weighty="1.0"/>
          </tr>
          <tr>
             <param colspan="1" expand="true" fill="both" oid="params.id2" rowspan="1" runtasksonload="true" showlabel="false" weightx="1.0" weighty="1.0">
                <task tasktype="ogscript">updateInfo('params.id2', 'params.info2');</task>
             </param>
             <param colspan="1" editable="false" expand="true" fill="both" oid="params.info2" rowspan="1" weightx="1.0" weighty="1.0" widget="text"/>
             <dropspot colspan="1" fill="both" rowspan="1" weightx="1.0" weighty="1.0"/>
          </tr>
          <tr>
             <dropspot colspan="1" fill="both" rowspan="1" weightx="1.0" weighty="1.0"/>
             <dropspot colspan="1" fill="both" rowspan="1" weightx="1.0" weighty="1.0"/>
             <dropspot colspan="1" fill="both" rowspan="1" weightx="1.0" weighty="1.0"/>
          </tr>
          <tr>
             <param colspan="1" expand="true" fill="both" oid="params.id3" rowspan="1" runtasksonload="true" showlabel="false" weightx="1.0" weighty="1.0">
                <task tasktype="ogscript">updateInfo('params.id3', 'params.info3');</task>
             </param>
             <param colspan="1" editable="false" expand="true" fill="both" oid="params.info3" rowspan="1" showlabel="false" weightx="1.0" weighty="1.0"/>
             <dropspot colspan="1" fill="both" rowspan="1" weightx="1.0" weighty="1.0"/>
          </tr>
          <tr>
             <param colspan="1" expand="true" fill="both" oid="params.id4" rowspan="1" runtasksonload="true" showlabel="false" weightx="1.0" weighty="1.0">
                <task tasktype="ogscript">updateInfo('params.id4', 'params.info4');</task>
             </param>
             <param colspan="1" editable="false" expand="true" fill="both" oid="params.info4" rowspan="1" weightx="1.0" weighty="1.0" widget="text"/>
             <dropspot colspan="1" fill="both" rowspan="1" weightx="1.0" weighty="1.0"/>
          </tr>
          <tr>
             <dropspot colspan="1" fill="both" rowspan="1" weightx="1.0" weighty="1.0"/>
             <dropspot colspan="1" fill="both" rowspan="1" weightx="1.0" weighty="1.0"/>
             <dropspot colspan="1" fill="both" rowspan="1" weightx="1.0" weighty="1.0"/>
          </tr>
          <tr>
             <param colspan="1" expand="true" fill="both" oid="params.id5" rowspan="1" runtasksonload="true" showlabel="false" weightx="1.0" weighty="1.0">
                <task tasktype="ogscript">updateInfo('params.id5', 'params.info5');</task>
             </param>
             <param colspan="1" editable="false" expand="true" fill="both" oid="params.info5" rowspan="1" showlabel="false" weightx="1.0" weighty="1.0"/>
             <dropspot colspan="1" fill="both" rowspan="1" weightx="1.0" weighty="1.0"/>
          </tr>
          <tr>
             <param colspan="1" expand="true" fill="both" oid="params.id6" rowspan="1" runtasksonload="true" showlabel="false" weightx="1.0" weighty="1.0">
                <task tasktype="ogscript">updateInfo('params.id6', 'params.info6');</task>
             </param>
             <param colspan="1" editable="false" expand="true" fill="both" oid="params.info6" rowspan="1" weightx="1.0" weighty="1.0" widget="text"/>
             <dropspot colspan="1" fill="both" rowspan="1" weightx="1.0" weighty="1.0"/>
          </tr>
       </table>
       <button buttontype="push" height="103" left="66" name="PLAY" top="467" width="405">
          <task tasktype="ogscript"/>
          <task tasktype="ogscript">var host = params.getValue('IP_Server', 0);
    var port = 5250;
    var cg = 'CG 1-20 ADD 1 '
    var file = params.getValue('file',0);
    var f0 = params.getValue('componentData1', 0) + 'f0' +params.getValue('componentData2',0) + params.getValue('params.info1',0) + params.getValue('componentData3',0);
    var f1 = params.getValue('componentData1', 0) + 'f1' +params.getValue('componentData2',0) + params.getValue('params.info2',0) + params.getValue('componentData3',0);
    var f2 = params.getValue('componentData1', 0) + 'f2' +params.getValue('componentData2',0) + params.getValue('params.info3',0) + params.getValue('componentData3',0);
    var f3 = params.getValue('componentData1', 0) + 'f3' +params.getValue('componentData2',0) + params.getValue('params.info4',0) + params.getValue('componentData3',0);
    var f4 = params.getValue('componentData1', 0) + 'f4' +params.getValue('componentData2',0) + params.getValue('params.info5',0) + params.getValue('componentData3',0);
    var f5 = params.getValue('componentData1', 0) + 'f5' +params.getValue('componentData2',0) + params.getValue('params.info6',0) + params.getValue('componentData3',0);
    
    var message =  cg + file + ' 1 ' + params.getValue('templateData1',0) + f0 + f1 + f2 + f3 + f4 + f5 + params.getValue('templateData2',0);
    
    
    rosstalk.sendMessage(host, port, message, null);</task>
       </button>
       <split height="228" left="38" orientation="vertical" top="626" width="1116">
          <abs weight="0.5"/>
          <abs>
             <param expand="true" height="34" left="776" name="IP_Server" oid="IP_Server" top="12" width="243"/>
             <param expand="true" height="34" left="776" name="File" oid="file" top="51" width="243"/>
             <param expand="true" height="34" left="31" oid="templateData1" top="15" width="204"/>
             <param expand="true" height="34" left="31" oid="componentData1" top="54" width="204"/>
             <param expand="true" height="34" left="31" oid="componentData2" top="93" width="204"/>
             <param expand="true" height="34" left="31" oid="componentData3" top="132" width="204"/>
             <param expand="true" height="34" left="31" oid="templateData2" top="171" width="204"/>
          </abs>
       </split>
    </abs>

    #DashBoard


  • 16.  RE: XML link in paramteters

    Posted 04-13-2017 09:00
    Hi James

    I am trying the same method with the code you provided. I am trying to create the same schema as above but my dahsboard keeps saying "ID NOT FOUND"

    Any suggestions?

    #DashBoard


  • 17.  RE: XML link in paramteters

    Posted 05-10-2017 08:59

    Hi James, I am having trouble reading my XML Into dashboard. I am using the above given script. It is not allowing me to upload my XML saying that it is an invalid document

    "‹<abs contexttype="opengear">
    <meta>
    <params>
    <param access="1" maxlength="0" name="Info 1" oid="params.info1" type="STRING" value="ID NOT FOUND" widget="default"/>
    <param access="1" maxlength="0" name="Info 2" oid="params.info2" type="STRING" value="ID NOT FOUND" widget="default"/>
    <param access="1" maxlength="0" name="Info 3" oid="params.info3" type="STRING" value="ID NOT FOUND" widget="default"/>
    <param access="1" maxlength="0" name="Info 4" oid="params.info4" type="STRING" value="ID NOT FOUND" widget="default"/>
    <param access="1" maxlength="0" name="Info 5" oid="params.info5" type="STRING" value="ID NOT FOUND" widget="default"/>
    <param access="1" maxlength="0" name="Info 6" oid="params.info6" type="STRING" value="ID NOT FOUND" widget="default"/>
    <param access="1" maxlength="0" name="ID 1" oid="params.id1" type="STRING" value="10" widget="default"/>
    <param access="1" maxlength="0" name="ID 2" oid="params.id2" type="STRING" value="10" widget="default"/>
    <param access="1" maxlength="0" name="ID 3" oid="params.id3" type="STRING" value="30" widget="default"/>
    <param access="1" maxlength="0" name="ID 4" oid="params.id4" type="STRING" value="30" widget="default"/>
    <param access="1" maxlength="0" name="ID 5" oid="params.id5" type="STRING" value="40" widget="default"/>
    <param access="1" maxlength="0" name="ID 6" oid="params.id6" type="STRING" value="40" widget="default"/>
    <param access="1" maxlength="0" name="IP_Server" oid="IP_Server" type="STRING" value="127.0.0.1" widget="text"/>
    <param access="1" maxlength="0" name="file" oid="file" type="STRING" value="bandelette5" widget="text"/>
    <param access="1" maxlength="0" name="templateData1" oid="templateData1" type="STRING" value="&quot;&lt;templateData&gt;" widget="text"/>
    <param access="1" maxlength="0" name="componentData1" oid="componentData1" type="STRING" value="&lt;componentData id=\&quot;" widget="text"/>
    <param access="1" maxlength="0" name="componentData2" oid="componentData2" type="STRING" value="\&quot;&gt;&lt;data id=\&quot;text\&quot; value=\&quot;" widget="text"/>
    <param access="1" maxlength="0" name="componentData3" oid="componentData3" type="STRING" value=" \&quot;/&gt;&lt;/componentData&gt;" widget="default"/>
    <param access="1" maxlength="0" name="templateData2" oid="templateData2" type="STRING" value="&lt;/templateData&gt;&quot;\r\n" widget="text"/>
    </params>
    </meta>
    <meta>
    <api immediate="true">//CALLING THIS WHENEVER YOU WANT TO RELOAD THE XML
    function initXML()
    {
    //REPLACE THIS WITH A CALL TO PARSE YOUR ACTUAL XML DOCUMENT
    var xml = ogscript.parseXML('NH2017.xml');
    ogscript.putObject("XMLDoc", xml);
    }


    //PROVIDE THE OID OF THE PARAMETER WITH THE "ID" AND THE OID OF THE PARAMETER WHOSE VALUE YOU'D LIKE TO FILL
    function updateInfo(idOID, infoOID)
    {
    var xmlDoc = ogscript.getObject("XMLDoc"); //TRY TO GET THE XML DOCUMENT
    if (xmlDoc == null)
    {
    params.setValue(infoOID, 0, "XML NOT LOADED");
    }


    var id = params.getValue(idOID, 0); //GET THE ID
    var nodeList = ogscript.runXPath("/team/squad/player[@ID='" + id + "']", xmlDoc); //THIS IS AN XPATH COMMAND TO FIND PLAYERS WITH THE CORRECT ID LEARN MORE ABOUT XPATH AT https://www.w3schools.com/xml/xpath_intro.asp
    if (nodeList != null &amp;&amp; nodeList.getLength() &gt; 0) //IF OUR XPATH COMMAND RETURNED RESULTS
    {
    var node = nodeList.item(0);
    params.setValue(infoOID, 0, node.getAttribute("name")); //FILL THE VALUE
    }
    else
    {
    params.setValue(infoOID, 0, "ID NOT FOUND");
    }
    }


    initXML(); //RELOAD THE XML AT THE START TO MAKE SURE IT IS IN THE SYSTEM</api>
    </meta>
    <table height="381" left="61" top="32" width="1113">
    <tr>
    <param colspan="1" expand="true" fill="both" oid="params.id1" rowspan="1" runtasksonload="true" showlabel="false" weightx="1.0" weighty="1.0">
    <task tasktype="ogscript">updateInfo('params.id1', 'params.info1');</task>
    </param>
    <param colspan="1" editable="false" expand="true" fill="both" oid="params.info1" rowspan="1" showlabel="false" weightx="1.0" weighty="1.0"/>
    <dropspot colspan="1" fill="both" rowspan="1" weightx="1.0" weighty="1.0"/>
    </tr>
    <tr>
    <param colspan="1" expand="true" fill="both" oid="params.id2" rowspan="1" runtasksonload="true" showlabel="false" weightx="1.0" weighty="1.0">
    <task tasktype="ogscript">updateInfo('params.id2', 'params.info2');</task>
    </param>
    <param colspan="1" editable="false" expand="true" fill="both" oid="params.info2" rowspan="1" weightx="1.0" weighty="1.0" widget="text"/>
    <dropspot colspan="1" fill="both" rowspan="1" weightx="1.0" weighty="1.0"/>
    </tr>
    <tr>
    <dropspot colspan="1" fill="both" rowspan="1" weightx="1.0" weighty="1.0"/>
    <dropspot colspan="1" fill="both" rowspan="1" weightx="1.0" weighty="1.0"/>
    <dropspot colspan="1" fill="both" rowspan="1" weightx="1.0" weighty="1.0"/>
    </tr>
    <tr>
    <param colspan="1" expand="true" fill="both" oid="params.id3" rowspan="1" runtasksonload="true" showlabel="false" weightx="1.0" weighty="1.0">
    <task tasktype="ogscript">updateInfo('params.id3', 'params.info3');</task>
    </param>
    <param colspan="1" editable="false" expand="true" fill="both" oid="params.info3" rowspan="1" showlabel="false" weightx="1.0" weighty="1.0"/>
    <dropspot colspan="1" fill="both" rowspan="1" weightx="1.0" weighty="1.0"/>
    </tr>
    <tr>
    <param colspan="1" expand="true" fill="both" oid="params.id4" rowspan="1" runtasksonload="true" showlabel="false" weightx="1.0" weighty="1.0">
    <task tasktype="ogscript">updateInfo('params.id4', 'params.info4');</task>
    </param>
    <param colspan="1" editable="false" expand="true" fill="both" oid="params.info4" rowspan="1" weightx="1.0" weighty="1.0" widget="text"/>
    <dropspot colspan="1" fill="both" rowspan="1" weightx="1.0" weighty="1.0"/>
    </tr>
    <tr>
    <dropspot colspan="1" fill="both" rowspan="1" weightx="1.0" weighty="1.0"/>
    <dropspot colspan="1" fill="both" rowspan="1" weightx="1.0" weighty="1.0"/>
    <dropspot colspan="1" fill="both" rowspan="1" weightx="1.0" weighty="1.0"/>
    </tr>
    <tr>
    <param colspan="1" expand="true" fill="both" oid="params.id5" rowspan="1" runtasksonload="true" showlabel="false" weightx="1.0" weighty="1.0">
    <task tasktype="ogscript">updateInfo('params.id5', 'params.info5');</task>
    </param>
    <param colspan="1" editable="false" expand="true" fill="both" oid="params.info5" rowspan="1" showlabel="false" weightx="1.0" weighty="1.0"/>
    <dropspot colspan="1" fill="both" rowspan="1" weightx="1.0" weighty="1.0"/>
    </tr>
    <tr>
    <param colspan="1" expand="true" fill="both" oid="params.id6" rowspan="1" runtasksonload="true" showlabel="false" weightx="1.0" weighty="1.0">
    <task tasktype="ogscript">updateInfo('params.id6', 'params.info6');</task>
    </param>
    <param colspan="1" editable="false" expand="true" fill="both" oid="params.info6" rowspan="1" weightx="1.0" weighty="1.0" widget="text"/>
    <dropspot colspan="1" fill="both" rowspan="1" weightx="1.0" weighty="1.0"/>
    </tr>
    </table>
    <button buttontype="push" height="103" left="66" name="PLAY" top="467" width="405">
    <task tasktype="ogscript"/>
    <task tasktype="ogscript">var host = params.getValue('IP_Server', 0);
    var port = 5250;
    var cg = 'CG 1-20 ADD 1 '
    var file = params.getValue('file',0);
    var f0 = params.getValue('componentData1', 0) + 'f0' +params.getValue('componentData2',0) + params.getValue('params.info1',0) + params.getValue('componentData3',0);
    var f1 = params.getValue('componentData1', 0) + 'f1' +params.getValue('componentData2',0) + params.getValue('params.info2',0) + params.getValue('componentData3',0);
    var f2 = params.getValue('componentData1', 0) + 'f2' +params.getValue('componentData2',0) + params.getValue('params.info3',0) + params.getValue('componentData3',0);
    var f3 = params.getValue('componentData1', 0) + 'f3' +params.getValue('componentData2',0) + params.getValue('params.info4',0) + params.getValue('componentData3',0);
    var f4 = params.getValue('componentData1', 0) + 'f4' +params.getValue('componentData2',0) + params.getValue('params.info5',0) + params.getValue('componentData3',0);
    var f5 = params.getValue('componentData1', 0) + 'f5' +params.getValue('componentData2',0) + params.getValue('params.info6',0) + params.getValue('componentData3',0);


    var message = cg + file + ' 1 ' + params.getValue('templateData1',0) + f0 + f1 + f2 + f3 + f4 + f5 + params.getValue('templateData2',0);



    rosstalk.sendMessage(host, port, message, null);</task>
    </button>
    <split height="228" left="38" orientation="vertical" top="626" width="1116">
    <abs weight="0.5"/>
    <abs>
    <param expand="true" height="34" left="776" name="IP_Server" oid="IP_Server" top="12" width="243"/>
    <param expand="true" height="34" left="776" name="File" oid="file" top="51" width="243"/>
    <param expand="true" height="34" left="31" oid="templateData1" top="15" width="204"/>
    <param expand="true" height="34" left="31" oid="componentData1" top="54" width="204"/>
    <param expand="true" height="34" left="31" oid="componentData2" top="93" width="204"/>
    <param expand="true" height="34" left="31" oid="componentData3" top="132" width="204"/>
    <param expand="true" height="34" left="31" oid="templateData2" top="171" width="204"/>
    </abs>
    </split>
    </abs>

    #DashBoard


  • 18.  RE: XML link in paramteters

    Posted 05-10-2017 13:33

    Schema1.zip This is my Schema


    #DashBoard


  • 19.  RE: XML link in paramteters

    Posted 05-10-2017 14:55

    It looks like you were pasting the entire XML document into the script source editor.
    To use the snippet, you'll want to paste it into the "Source" tab of a blank custom panel. You can then grab the code and take a closer look.



    #DashBoard


  • 20.  RE: XML link in paramteters

    Posted 07-30-2019 20:50

    Should this example still work on DB 8.6? I cannot get the sample code to update at all - the table never changes from ID not found when I try this in a new blank panel. I have tried assigning a button which calls the update XML API function, but still no joy - what am I missing here?


    #DashBoard


  • 21.  RE: XML link in paramteters

    Posted 07-31-2019 21:34

    Hi Dave.

    Which example did you copy? I just tried the one that I posted earlier in the thread and it worked correctly in DashBoard 8.6 - there should be absolutely no changes that would impact you on this.

    The only trick to get my example working was that you needed to enter a valid ID on the left to see the associated player info on the right - mine defaults to 0 but if you change to 1 or 2, you should see the info.

     

    James


    #DashBoard