Facility Control

 View Only
  • 1.  Dashboard - Change Toggle On/Off styles via script

    Posted 16 days ago

    Greetings!

    So, I'd like to have a parameter (dropdown list) dynamically change a Toggle Button "On and Off" states' background texture based on the dropdown list parameter value.

    Toggle Button OID: button_left
    Dropdown OID: mapPick
    Images are located on the Images/Dashboard/ folder relative to the panel location and follows the "icon_xxxxx_on" and "icon_xxxxx_off" logic.

    Here's what I currently have under the mapPick parameter script:

    var value = params.getValueAsString('mapPick', 0);

    var style = 't:bg-u:Images/Dashboard/icon_' + value + '_on.png;f:bg-u:Images/Dashboard/icon_' + value + '_off.png');
    ogscript.setStyle('button_left', style);

    I had success changing a regular "abs" texture with a similar method. Any help would be appreciated!



    ------------------------------
    Victor Alexis
    São Paulo Brazil
    ------------------------------


  • 2.  RE: Dashboard - Change Toggle On/Off styles via script

    Posted 16 days ago

    Hi Victor,

    ogscript.setStyle uses the first argument as the component id. You need to ensure that button_left is set as the id instead of the oid, or set both if you want to keep the same name for the oid.




    ------------------------------
    Cheers,

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



  • 3.  RE: Dashboard - Change Toggle On/Off styles via script

    Posted 14 days ago

    That did it! Thank you



    ------------------------------
    Victor Alexis
    São Paulo Brazil
    ------------------------------