Facility Control

 View Only
  • 1.  Dashboard and internet browser

    Posted 10-24-2014 15:05
    Hi,

    I would like to specify the url of the internet browser by a variable. What I've seen so far is that the url is pretty static and cannot be changed on the fly.

    Is there a way to do this?

    Thanks in advance

    Bruno


  • 2.  RE: Dashboard and internet browser

    Posted 10-24-2014 15:35

    Unfortunately, no. At present, the URL must be set when the browser is created (we hope to expose a setUrl in the future but due to limitations in the current implementation, this is not as easy as it sounds).

    The closest you can get to dynamically setting a URL is to use a lookup table or parameter value as the URL and then reload the component...

    Here is a fairly small example that demonstrates the concept:

    ogscript.reload('MyBrowser');

    #DashBoard


  • 3.  RE: Dashboard and internet browser

    Posted 10-24-2014 15:39
    Note the important part (the part that makes it dynamic) is that the url attribute of the browser tag is %value[0x1][0]% - This tells DashBoard to use the value of element 0 of the parameter with OID 0x1 as the URL.

    You can also reference a lookup table this way with %const['lookup id']['entry key']%

    At the moment, you can only reference parameters with numeric OIDs with the %value...%

    #DashBoard


  • 4.  RE: Dashboard and internet browser

    Posted 10-27-2014 20:22
    Thanks James. I've tried this and it works. Thanks a lot.

    #DashBoard


  • 5.  RE: Dashboard and internet browser

    Posted 02-20-2020 16:36

    Howdy James, 

     

    Working with Dashboard 8.8 and when I attempt to set my browser as a param or var I am getting an error reading "Open quote is expected for attribute "url" associated with element time "browser".  is there a good way around this to have the url reference a non-quoted item?


    #DashBoard


  • 6.  RE: Dashboard and internet browser

    Posted 03-04-2020 18:38

    Hi Brandon

    It looks like there is an issue with your XML and that the opening quote may have been deleted. I should also point-out that we have since added the ability to set the URL through ogScript so the method mentioned in this thread is a bit out of date.  You can now use ogscript.getComponentsById('ID_OF_YOUR_BROWSER_TAG')[0].setUrl('URL_OF_WEB_PAGE');

    Here is an example Custom Panel that demonstrates the updated technique:

    <abs contexttype="opengear" style="">
    <meta>
    <params>
    <param access="1" maxlength="0" name="URL" oid="URL" type="STRING" value="http://www.google.ca" widget="text"/>
    </params>
    </meta>
    <browser bottom="5" id="browser" left="5" right="5" top="50" url="%value['URL'][0]%"/>
    <param expand="true" height="36" left="6" oid="URL" right="101" top="5"/>
    <button buttontype="push" height="41" name="GO!" right="5" top="3" width="93">
    <task tasktype="ogscript">ogscript.getComponentsById('browser')[0].setUrl(params.getValue('URL', 0));</task>
    </button>
    </abs>

     

    Cheers

    James


    #DashBoard