Facility Control

 View Only
  • 1.  Toggle button question

    Posted 12-15-2014 17:26
    Hope this is an easy question...

    Is there an easier way to assign two separate options to a toggle button? Until now, I've been using a choice constraint parameter with the toggle button widget, and then scripting "if this = 1 then do this, if this = 0 then do that"

    Is that the only way, or is there a way to do this in the regular button objects?

    Thanks!


  • 2.  RE: Toggle button question

    Posted 12-15-2014 19:19

    That's the recommended way of doing it.

    If you really don't want to use a parameter for it, you can access the `isSelected()` property of the component (though this is not guaranteed to be compatible with all future revisions of DashBoard.

    `

    if (component.isSelected())

    {

    ogscript.debug('Toggle on!');

    }

    else

    {

    ogscript.debug('Toggle off!');

    }

    `

    #DashBoard