Facility Control

 View Only
  • 1.  Dashboard Custom Panel with buttons to change the content of a Browser component

    Posted 04-21-2025 10:54

    Greetings Ross Community!

    I am trying to create a Dashboard Custom Panel with a Browser component and 3 Buttons. The behavior for each button is to load a different URL in the Browser component.

    Is this possible?

    Thank you in advance for your help

    Martin



    ------------------------------
    Martin Jolicoeur
    Project Lead
    CBC/Radio-Canada
    ------------------------------


  • 2.  RE: Dashboard Custom Panel with buttons to change the content of a Browser component
    Best Answer

    Posted 04-21-2025 11:19

    Hi Martin

    Yes, it is possible to do this with a small piece of ogScript: 

    ogscript.getBrowserById('ID_OF_BROWSER_CONTROL').setUrl('URL_GOES_HERE');

    Here it is in an example:

    <abs contexttype="opengear" style="">
    <meta>
    <params>
    <param access="1" constraintstrict="false" constrainttype="STRING_STRING_CHOICE" maxlength="0" name="URL" oid="URL" type="STRING" value="http://www.google.ca" widget="radio-toggle">
    <constraint key="http://www.google.ca">Google</constraint>
    <constraint key="http://www.cbc.ca">CBC</constraint>
    <constraint key="http://www.canada.ca">Canada</constraint>
    </param>
    </params>
    </meta>
    <browser bottom="5" id="browser" left="5" right="5" top="50" url="%value['URL'][0]%"/>
    <param expand="true" height="36" left="5" oid="URL" right="5" top="5">
    <task tasktype="ogscript">ogscript.getBrowserById('browser').setUrl(params.getValue('URL', 0));</task>
    </param>
    </abs>



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



  • 3.  RE: Dashboard Custom Panel with buttons to change the content of a Browser component

    Posted 04-21-2025 11:20

    The bonus bit in the example is that the browser is set to the current value of the URL parameter when it is created by using:

    <browser bottom="5" id="browser" left="5" right="5" top="50" url="%value['URL'][0]%"/>


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



  • 4.  RE: Dashboard Custom Panel with buttons to change the content of a Browser component

    Posted 04-28-2025 13:58

    Works great! Thank you James



    ------------------------------
    Martin Jolicoeur
    Project Lead
    CBC/Radio-Canada
    ------------------------------