Your Universal Remote Control Center
RemoteCentral.com
Philips Pronto Professional Forum - View Post
Up level
Up level
The following page was printed from RemoteCentral.com:

Login:
Pass:
 
 

Original thread:
Post 16 made on Tuesday June 4, 2019 at 18:16
Lyndel McGee
RC Moderator
Joined:
Posts:
August 2001
12,997
The issue is that the Page.onExit call's 'this' is the global scope and it cannot resolve the function named 'close'. The following code should tell you if you have this problem.

CF.page().onExit = function() {
try {
close(); }
catch(e) {
System.print('error e:' + e);
}
}

should illustrate the problem. The only solution to this is to put a reference to the scope containing close into the page at the same time as you set the onExit().

With regard to 'null'ing out the CF.page().onExit, consider the following.
You PageUp to exit the page and your close() code is called. Even though you have moved to a different page, the JavaScript for the page you just left is still available as the page is still in the Prontoscript 'activity' scope as you have not exited the activity. Therefore, when you come back into it via PageDown, etc, the previous onExit call to 'close()' is still there even though you may not have shown a dialog.

Think of it as similar to this scenario. You put a post-it note on the fridge, you do the task on the note, but then you don't remove the note after completion.
You leave the house and then your spouse comes home, and then sees the note, and does the task a 2nd time. Which in certain cases may cause damage, especially if the task on the note states "Strip, sand, stain, and refinish the hardwood floor in the kitchen".
Lyndel McGee
Philips Pronto Addict/Beta Tester


Hosting Services by ipHouse