This example shows you how to change some parameter of the graphic item in your GUI.
We change a text field of the item from the word to the real value received from equipment and back. It is possible using tags of graphic item.
If you want to open some default page or popup each time when maximizing the iRidium app, use the example attached
Q:
// array of items var gRegisters = [ {item: IR.GetItem("Page 1").GetItem("1")}, {item: IR.GetItem("Page 1").GetItem("2")}, {item: IR.GetItem("Page 1").GetItem("3")}, ]; function OnPress() { // when we do something when pressing of an array item, this. - an indicator to the item IR.Log("Pressed: " + this.Name); IR.Log(this.Name + " Value: " + this.Value); } // creation of listeners for all array items function RegisterButton() { for(var i = 0; i < gRegisters.length; i++) { var item = gRegisters[i].item; IR.AddListener(IR.EVENT_ITEM_PRESS, item, OnPress, item); } } // the function which is executed at launch function Start() { RegisterButton(); } // begin creating listeners IR.AddListener(IR.EVENT_START,0, Start);To get access to the data of a graphic item inside the OnPress function, it is necessary to refer to it using the link this. For example:
function OnPress() { var NameOfItem = this.Name; IR.Log( NameOfItem ); }
IR.AddListener(IR.EVENT_ITEM_PRESS, item, OnPress, item);