Facility Control

 View Only
  • 1.  Dashboard STRUCT Table - Show working buttons inside cells

    Posted 26 days ago

    Hello ! 

    I was fiddeling around with STRUCTs and STRUCT_ARRAYs for a table. I was able to setup a dropdown widget to show up in one column for each row. Also a toggle/checkbox was achievable. That's pretty neat and will definitely come in handy for a lot of things. 

    However I was wondering If it is possible to show a non-data related component in a cell but instead render a button for example that triggers an action/task ? My Goal was to have this button for each row in the last column. 

    ```

             <param access="1" constrainttype="STRUCT" name="Struct template" oid="player_template" type="STRUCT" widget="table">
                <value>
                   <subparam access="0" maxlength="0" name="First Name" suboid="fname" type="STRING" value="First" widget="default"/>
                   <subparam access="0" maxlength="0" name="Last Name" suboid="lname" type="STRING" value="Last" widget="default"/>
                   <subparam access="0" constrainttype="INT_NULL" name="Jersey" precision="0" suboid="jersey" type="INT16" value="0" widget="default"/>
                   <subparam access="0" maxlength="0" name="Team" suboid="team" type="STRING" value="Team" widget="default"/>
                   <subparam access="0" constrainttype="FLOAT_NULL" name="Height" precision="3" suboid="height" type="FLOAT32" value="2.0" widget="default"/>
                   <subparam access="0" maxlength="0" name="Favourite Color" suboid="favouriteColor" type="STRING" value="Color" widget="default"/>
                   <subparam access="1" constrainttype="INT_CHOICE" name="Action" precision="0" suboid="action" type="INT32" value="0" widget="button">
                      <constraint key="0">SEND</constraint>
                      <constraint key="1">SEND</constraint>
                   </subparam>
                </value>
             </param>
             <param access="1" constrainttype="STRUCT" name="Struct table" oid="players" templateoid="player_template" type="STRUCT_ARRAY" widget="table">
                <value>
                   <subparam suboid="fname" value="Charles"/>
                   <subparam suboid="lname" value="Barkley"/>
                   <subparam suboid="jersey" value="34"/>
                   <subparam suboid="team" value="Suns"/>
                   <subparam suboid="height" value="1.98"/>
                   <subparam suboid="favouriteColor" value="BLUE"/>
                   <subparam suboid="action" value="1"/>
                </value>

    ...

    ```


    Any ideas/pointers are highly appreciated ! 

    Cheers,
    Pascal 



    ------------------------------
    Pascal Lamers
    Broadcast Automations Specialist
    ------------------------------


  • 2.  RE: Dashboard STRUCT Table - Show working buttons inside cells

    Posted 26 days ago

    The table can only take parameters so you'll want to create a parameter with an INT_CHOICE or String/String Choice constraint and a Push Button or Toggle Button widget hint and then trigger tasks when that button parameter changes.



    ------------------------------
    James Peltzer
    Ross Video
    ------------------------------



  • 3.  RE: Dashboard STRUCT Table - Show working buttons inside cells

    Posted 24 days ago

    Thanks for your suggestion James ! I believe this is what I come up with in the end, to use a subparam with constrainttype INT_CHOICE. However I am having difficulties to find the right widget for it. So far only widget="button" seems to give me an actual button, instead of a dropdown. I tried a few other wordings for push button or toggle button but no luck. Couldn't find a list of available "widget" values. 

      <subparam access="1" constrainttype="INT_CHOICE" name="Action" precision="0" suboid="action" type="INT32" value="0" widget="button">
        <constraint key="0">SEND</constraint>
        <constraint key="1">SEND</constraint>
      </subparam>

    What would be the next steps to get a change trigger for that parameter, like you suggested ? 



    ------------------------------
    Pascal Lamers
    Broadcast Automations Specialist
    ------------------------------



  • 4.  RE: Dashboard STRUCT Table - Show working buttons inside cells

    Posted 24 days ago

    You can get a good list of most widget hints available in the param edtior UI.  They are largely the same for structs as they are for regular parameters:

    Once you create a basic parameter you can go to the source view to see the string used for that widget hint



    ------------------------------
    James Peltzer
    Ross Video
    ------------------------------



  • 5.  RE: Dashboard STRUCT Table - Show working buttons inside cells

    Posted 22 days ago
    If you want to execute a task when a parameter is updated, you can include the `oid` attribute in the `<ogscript>` tag to trigger the task whenever the specified parameter is updated.
    (However, please be careful not to create an infinite loop of parameter updates.)
     
    By using this in conjunction with "this", you can also change the behavior depending on whether the button is on or off.
     
    Using this, you might be able to make a toggle button behave like a push button.

    The following is the code I used to create a page that displays or hides content based on parameter values.
    <ogscript handles="onchange,onload" name="subMenuActive" oid="selector.subMenuActive" targetid="submenu">
    if(this==null){
    params.setValue('selector.subMenuActive', 0, 0);
    return;
    }
    if(this.value==1){
    ogscript.reveal('submenu');
    }else if(this.value==0){
    ogscript.hide('submenu');
    }
    </ogscript>


    ------------------------------
    Keisuke Nagata
    ------------------------------