0
Answered

Trigger popups on tag value changing

Iain Brew 2 months ago in Tips and Tricks • updated by Ilya Markov (expert) 2 months ago 1

I have been teaching myself building server projects using tags and having a good time. I want to step up to the next level and achieve the following:


If a server tag (example) has a particular value written to it (either a text string or number), I want to then trigger a popup to open or close. i.e.


If server tag "example" = x

then

open/close popup/page "name_of_popup"


I have looked more into the Javascript thing (i.e. using a tag like a feedback channel) but I am a bit stuck with this element. An advice would be appreciated! The rationale behind this is for multi-control panel projects. If i shut down the system on one control, I want the other controls to also show the 'shut down' screen.


GOOD, I'M SATISFIED

Thanks for the great help as always :)

Satisfaction mark by Iain Brew 4 weeks ago
Answered

hello.

Open Popup function here http://dev.iridiummobile.net/GUI_API/en#IR.ShowPopup

Close popup function here http://dev.iridiummobile.net/GUI_API/en#IR.HidePopup


In panel project, you should use EVENT_TAG_CHANGE event for AddListener http://dev.iridiummobile.net/Drivers_API/en#IR.EVENT_TAG_CHANGE 

. in this event you should write script like this

if (name == example)

{

  if (value == "open popup")

  {

      IR.OpenPopup("popup name")

  }

  if (value == "close popup")

  {

      IR.HidePopup("popup name")

  }


}