Facility Control

 View Only
  • 1.  Feature Request: ogscript.alert()

    Posted 11-24-2019 22:34

    It would be really great to be able to show messages to the user from within the DashBoard UI when necessary. Could it be worked out to write some code like this...

    ogscript.alert('Hello world');

    Which would then show an alert box with "Hello world"? I already make use of the ogscript.debug() command, but this does not show a message in a pop-up box, instead prints to the debug window...

    Much appreciated

    ---landon



  • 2.  RE: Feature Request: ogscript.alert()

    Ross Staff
    Posted 11-26-2019 17:01

    Hi Landon,

    This is a great idea and is certainly on our radar. I will be sure to update this post if the feature is added in the future. In the meantime, you can obtain similar functionality from a bit of extra ogScript code. I've attached a code snippet below which demonstrates this.

    The panel uses a full screen canvas with the visible="false" attribute to serve as a popup dialog. Using the ogscript.reveal() and ogscript.hide() commands we can control when this canvas is visible.

    Please let me know if you have any questions.

    Thanks,

     

    <abs contexttype="opengear" id="_top" keepalive="false" style="">
    <meta>
    <api>function alert(title, text)
    {
    ogscript.rename('dialog_title', title);
    ogscript.rename('dialog_text', '&lt;html&gt;' + text + '&lt;/html&gt;');
    ogscript.toTop('overlay');
    ogscript.reveal('overlay');
    }</api>
    </meta>
    <abs bottom="0" id="overlay" left="0" right="0" style="bg#0000007F;" top="0" visible="false">
    <abs height="258" left="575" style="bg#373131;" top="426" width="441">
    <label height="57" id="dialog_title" left="5" right="7" style="txt-align:center;bg#969735;size:Biggest;" top="8"/>
    <label bottom="7" height="179" id="dialog_text" left="9" name="" right="10" style="txt-align:center;"/>
    <button buttontype="push" height="44" left="112" name="OK" top="205" width="218">
    <task tasktype="ogscript">ogscript.hide("overlay");</task>
    </button>
    </abs>
    </abs>
    <button buttontype="push" height="85" left="68" name="Popup" top="75" width="176">
    <task tasktype="ogscript">alert("Warning", "This is a stern warning");</task>
    </button>
    </abs>

    #DashBoard


  • 3.  RE: Feature Request: ogscript.alert()

    Posted 10-10-2020 04:11

    Hiya

    How might I make this appear due to a specific tab/s being clicked? I have (multiple) config settings tabs; so along the lines of warning operators "Are you sure you want to go here?"

    Then on the pop-up; "No, get me 'outta here" would stay on the current/previous tab (Actually I suppose just not registering the mouse click). And of course "yes" would continue to the tab.

    Guessing it's somewhere in the this.getSelectedIndex(), but otherwise I have no idea how to add a task to a tab click.

     

    Thanks!


    #DashBoard


  • 4.  RE: Feature Request: ogscript.alert()

    Ross Staff
    Posted 10-13-2020 15:56

    Hi Paul

    You may find hiding your tabs and using the w.changeprompt as a config property on your tab selection parameter is a good choice to consider. Check out the following example:

    <abs contexttype="opengear" gridsize="20" id="_top" keepalive="true">
    <meta>
    <params>
    <param access="1" constraintstrict="false" constrainttype="STRING_STRING_CHOICE" maxlength="0" name="Tab Selector" oid="tab-selector" type="STRING" value="tab1" widget="radio-toggle">
    <constraint key="tab1">Tab One</constraint>
    <constraint key="tab2">Tab Two</constraint>
    <constraint key="tab3">Tab Three</constraint>
    </param>
    </params>
    </meta>
    <tab height="400" left="140" tabheight="100" tabposition="none" top="120" width="800">
    <abs id="tab1" name="Tab 1">
    <label height="60" left="0" name="I'm tab 1" style="txt-align:west" top="0" width="280"/>
    </abs>
    <abs id="tab2" name="Tab 2">
    <label height="60" left="0" name="I'm tab 2" style="txt-align:west" top="0" width="280"/>
    </abs>
    <abs id="tab3" name="Tab 3">
    <label height="60" left="0" name="I'm tab 3" style="txt-align:west" top="0" width="280"/>
    </abs>
    </tab>
    <simplegrid height="60" left="140" rows="1" top="60" width="800">
    <param expand="true" oid="tab-selector" runtasksonload="true" showlabel="false">
    <config key="w.changeprompt">Are you sure you want to do this?</config>
    <task tasktype="ogscript">ogscript.reveal(this.getValue());</task>
    </param>
    </simplegrid>
    </abs>

    #DashBoard


  • 5.  RE: Feature Request: ogscript.alert()

    Posted 10-14-2020 02:53

    Beautiful!!


    #DashBoard


  • 6.  RE: Feature Request: ogscript.alert()

    Posted 01-27-2024 19:33

    Hi there, following back up on this request.

    It would be super nice to be able to show a quick throw-down generic alert message to a user without having to build it into canvas UI elements...

    I can get dangerously close to the desired behavior using a Web Browser widget calling the javascript:alert() method which shows a pop-up message within DashBoard, but obviously this works within the browser environment and it would be nice to do this as a result of a button push in the native DashBoard grid file instead...

    Much appreciated,



    ------------------------------
    Landon Gaus
    KTRK
    ------------------------------



  • 7.  RE: Feature Request: ogscript.alert()

    Ross Staff
    Posted 01-30-2024 12:41

    Hi Landon,

    Thank you for sharing your feature request. Your suggestion has been forwarded to our product management team for consideration.

    Cheers,
    Aury R.



    ------------------------------
    Aury Rukazana
    Senior Software Developer
    Ross Video
    ------------------------------