Page 1 of 1

[ANSWERED]Execute script when control page opens?

PostPosted: Sat Nov 07, 2015 1:20 pm
by stevemac00
Am I missing something that should be obvious?

Otherwise any hack to do this? I tried the server status but it has to be clicked to execute a script.

Why? I need to initialize some indigo variables.

Re: Execute script when control page opens?

PostPosted: Sat Nov 07, 2015 1:25 pm
by kw123
you could do it on the calling page in "Edit actions"

Re: Execute script when control page opens?

PostPosted: Sat Nov 07, 2015 3:08 pm
by jay (support)
Not at the moment. Remember, however, that control pages can be opened by multiple devices at the same time. So if you're holding some kind of state for the page it could get rather messy... ;)

Re: [ANSWERED]Execute script when control page opens?

PostPosted: Fri Apr 28, 2017 5:56 am
by RedYuriPrime
Even though more than one user can in principal have a control page open, in practice a control page intended to configure profiles or sequences of actions may beneficially open with some of the variables represented by input boxes being set to null strings, to ensure they don't contain invalid values

However, under Indigo 7 it seems that the Server action/Edit Actions segment of a control page object does not run if there is a Client action set to move to another control page. I did have this working under Indigo 6, e.g on pressing a control page object first running the Client Action and then the Edit Action, so there seems to have been a change?

Any suggestions as to how to get around this? :shock:

Re: [ANSWERED]Execute script when control page opens?

PostPosted: Fri Apr 28, 2017 6:05 am
by matt (support)
Is this from Indigo Touch or from a browser? If I remember correctly, this is browser dependent (I think Indigo Touch should handle the case correctly). I don't recall which browsers it was, but some of them let the JavaScript call back to the server complete (which starts the server action) before they navigate away from the page, but others don't. It is possible a browser version update changed the behavior as well but I don't believe anything changed on Indigo's web server side from 6 to 7 that would explain the behavior changing.

Re: [ANSWERED]Execute script when control page opens?

PostPosted: Fri Apr 28, 2017 7:21 am
by RedYuriPrime
OK, I think you have got it spot on. :oops:

During development I tend to look at everything in a browser on the Mac running Indigo - under these circumstances it is not running the Edit Actions. However in Indigo Touch it is (at least some of the time, not entirely certain it is consistent when the connection is flakey). At least since I now understand what is going on, so it should avoid me going mad!

Many thanks! :D