Facility Control

 View Only
  • 1.  DASHBOARD XML QUERY

    Posted 07-17-2023 00:20

    Hi Guyz, posting my query again as i didnot get any favourable response the previous time. Would be glad if anyone can assist.

    Thanks

    MY QUERY
    I have an xml file which contains ID, Teamname, TRICODE, Player 1 to 5 names.
    I am able to import Teamname data into Dashboard (i am able to import only 1 data from my xml file)
    What i want to do is, based on my selection of the teamname from my dropdown list in Dashboard, i should get ALL the relevent players name also in my DASHBOARD.
    I will then connect all this to my xpression.
    The end result will be that i choose the team name on dashboard and my xpression graphic shows the team name and all the players in that team.
    My dashboard codes are 
     
    <abs contexttype="opengear" id="_top" keepalive="false">
       <meta>
          <params>
             <param access="1" constrainttype="INT_CHOICE" name="TEAMNAME" oid="TEAMNAME" precision="0" type="INT32" value="1" widget="combo">
                <constraint key="1">CLOUD</constraint>
                <constraint key="2">INFERNAL</constraint>
                <constraint key="3">MOUNTAIN</constraint>
                <constraint key="4">OCEAN</constraint>
             </param>
          </params>
       </meta>
       <abs height="460" left="79" style="bg#buttonbg;bdr#red;bdr:round;" top="64" width="582">
          <param expand="true" height="54" left="40" oid="TEAMNAME" top="120" width="154"/>
          <button buttontype="push" height="50" left="36" name="GET DATA" top="46" width="152">
             <task tasktype="ogscript">var xmlDocument = ogscript.parseXML('TEST INFO XML.xml');         //Parse the XML
       var nodeList = xmlDocument.getElementsByTagName("Team"); //Get the tags we want to include in the constraint
       var constraintData = [];   //Placeholder for the new constraint data
     
    for (var i = 0; i &lt; nodeList.getLength(); i++)           //Loop through each tag we found
    {   
       var node = nodeList.item(i);                          //Get the node
       constraintData.push({"key": parseInt(node.getAttribute("ID")), "value": node.getAttribute("TeamName")});  //Push the key/value pair
    }
     
    if (constraintData.length == 0)  //Placeholder if we don't have anything (OPTIONAL)
    {
       constraintData.push({"key": 0, "value": "Nothing"});
    }
     
    var constraint = params.createIntChoiceConstraint(constraintData);   //Create the constraint
    params.replaceConstraint("TEAMNAME", constraint);</task>
          </button>
       </abs>
    </abs>
     
    My xml file is 
    <TeamFile>
    <Team ID="1" TeamName="CLOUD" TRICODE="CLD" PLAYER1="RINGOKUN" PLAYER2="TIMA" PLAYER3="JERICHO" PLAYER4="CHICO" PLAYER5="CRAFT"/>
    <Team ID="2" TeamName="INFERNAL" TRICODE="INF" PLAYER1="SENMARIE" PLAYER2="TATSU" PLAYER3="GINROU" PLAYER4="MEYER" PLAYER5="PHONICS"/>
    <Team ID="3" TeamName="MOUNTAIN" TRICODE="MTN" PLAYER1="USSIE" PLAYER2="HALDES" PLAYER3="YUJI" PLAYER4="NEXUS GREEN" PLAYER5="LILLET"/>
    <Team ID="4" TeamName="OCEAN" TRICODE="OCN" PLAYER1="AIM4" PLAYER2="LACON" PLAYER3="AKAINU" PLAYER4="HOSHIZUKI" PLAYER5="FWRK"/>
    </TeamFile>


    ------------------------------
    Gaurav
    ------------------------------


  • 2.  RE: DASHBOARD XML QUERY

    Posted 09-12-2023 18:45
      |   view attached
    Hi Gaurav,
     
    I apologize for the delay, but I am pleased to provide you with the solution to your inquiry:
     
    In the aforementioned grid, only the ID and Team Name have been pushed into the constraintData array, rendering the Player Names inaccessible. To rectify this, we need to include the player names in the array. Once this adjustment is made, we can compare whether the selection in the dropdown menu matches the team ID. When this condition is met, we can effectively manage the player names. I have attached a grid panel that addresses this issue. It is important to note that this grid exclusively displays the player names as parameter labels. You can utilize these player names for any other tasks you may wish to perform. In this grid, a STRUCT data structure is used, enabling the grid to retain the data even when it is closed.
     
    I hope this solves your issue. Please feel free to reach out if this doesn't work for you.
     
    Best Regards,



    ------------------------------
    Altaz Daruwala
    Ross Video
    ------------------------------

    Attachment(s)

    txt
    XML Query.txt   8 KB 1 version