Facility Control

 View Only
  • 1.  Change tab with toggle buttom - Visual ogScript

    Posted 12-04-2017 18:57

    Hopefully I can explain this well enough for someone to help me. I am trying to allow switching between two tabs that live in a simple grid that lives in a table with a toggle button in another simple grid. I'm new to dashboard to my terminology my not be correct. I've tried making this happen with visual ogScript but haven't gotten it to work. I've attached two screen shots to show my attempt and what I am trying to do. At the top you'll seen the buttons for 'Tonight' and Season' referring to the stat options that will be revealed below. The column below will then changed depending on the selection. Thanks in advance for anyone that can help!



  • 2.  RE: Change tab with toggle buttom - Visual ogScript

    Posted 12-04-2017 19:21

    Hi nicks.
    The screen shots are helpful but do not contain quite enough information to see what is happening here.

    In terms of reacting to a change to your toggle parameter and having it reveal different tabs, I have attached an example panel of how such a panel might work. In your case, you're using an array parameter for "Season.Tonight.Team1" and doing a "switch" on the 6th element in the array... I can't say whether or not that is valid without seeing more of the code but it is somewhat unusual to have a tab selector as an array parameter. It is usually a single-element parameter where you care more about the value.

    If you post more of the code behind the panel, we may be able to assist you further. Also, sorry about the colour scheme in the attachment - it's pretty ugly but at least it was fast to put together!

    <abs contexttype="opengear" id="asdf">
       <meta>
          <params>
             <param access="1" constrainttype="INT_CHOICE" name="Tab Selection" oid="Tab.Selection" precision="0" type="INT16" value="3" widget="radio-toggle">
                <constraint key="0">Zero</constraint>
                <constraint key="1">One</constraint>
                <constraint key="2">Two</constraint>
                <constraint key="3">Three</constraint>
             </param>
          </params>
       </meta>
       <param expand="true" height="74" left="17" oid="Tab.Selection" runtasksonload="true" style="style:toggleButton;" top="19" width="324">
          <task tasktype="ogscript">
    
    
    /*! block id=1002,1003,1001 !*/
    ogscript.reveal(("Season" + params.getValue('Tab.Selection', 0)));
    /*! block id=1004,1005,1006 !*/
    ogscript.reveal(("Tonight" + params.getValue('Tab.Selection', 0)));
    /*!!
     &lt;block id="1002" type="ogscript_reveal" x="531" y="10" w="243" ID="ID:1003"  next="ID:1004" /&gt;
    &lt;block id="1003" type="math_add" x="283" y="10" VALUE="Season" VAL_1="ID:1001" w="218" VAL_1_1="" /&gt;
    &lt;block id="1001" type="param_asdfTab Selection (Tab.Selection)[0]" x="10" y="10" w="243" SET="" /&gt;
    &lt;block id="1004" type="ogscript_reveal" x="531" y="130" w="243" ID="ID:1005" /&gt;
    &lt;block id="1005" type="math_add" x="283" y="130" VALUE="Tonight" VAL_1="ID:1006" w="218" VAL_1_1="" /&gt;
    &lt;block id="1006" type="param_asdfTab Selection (Tab.Selection)[0]" x="10" y="130" w="243" SET="" /&gt;
    !!*/
    /*!!&lt;checksum&gt;aaf1a2474ae6d559b156dd5f3f03f7ce&lt;/checksum&gt;!!*/</task>
       </param>
       <simplegrid bottom="4" left="5" right="11" rows="1" top="100">
          <tab tabposition="none">
             <label id="Season0" name="Season Zero" style="bg#FF2929;"/>
             <label id="Season1" name="Season One" style="bg#3F62FF;"/>
             <label id="Season2" name="Season Two" style="bg#00ED30;"/>
             <label id="Season3" name="Season Three" style="bg#EFF900;"/>
          </tab>
          <tab tabposition="none">
             <label id="Tonight0" name="Tonight Zero" style="bg#BB47C1;"/>
             <label id="Tonight1" name="Tonight One" style="bg#C0C1F2;"/>
             <label id="Tonight2" name="Tonight Two" style="bg#2BE8E1;"/>
             <label id="Tonight3" name="Tonight Three" style="bg#E7AE33;"/>
          </tab>
       </simplegrid>
    </abs>

    James


    #DashBoard


  • 3.  RE: Change tab with toggle buttom - Visual ogScript

    Posted 12-05-2017 22:25
    Thanks jamespeltzer. I'm going to work through this to see if i get it working. I'll post the code if not.
    #DashBoard