tbfunction_pgExecuteRemote

Workarounds and usability notes.

tbfunction_pgExecuteRemote

Postby John Robin Dove » Sat Nov 18, 2023 9:22 am

Hi Clifton,
This may well be a stupid question but is there any difference between tbfunction_pgExecuteRemote("main", "tbfunction_pgTBObjSet", ["keys", "showWait"]); and top.keys.showWait()? I use both. Is that a problem?
John
John Robin Dove
 
Posts: 486
Joined: Thu Jan 23, 2014 4:35 am

Re: tbfunction_pgExecuteRemote

Postby Clifton » Sat Nov 18, 2023 2:06 pm

pgExecuteRemote() has considerably more features built into it. In does not just access the "main" window, but can asscess other window types that have been launched by the calling window. pgExecuterRemote() is able to access functions in non-Toolbook windows and retrieve data. This is really nice when using basic HTML files in windows and iframes and that must send data back to the calling window. In addition, if a function cannnot be executed, pgExecuteRemote() provide a more graceful exit mechanism so that your program doesn't just stop working. But as you showed in your example, if all that is needed is to call a function on an accessible object, you should be able to call it like you showed. It gets more complicated when that object is not readily available. pgExecuteRemote() can even do postMessage requests and then pass the data whenever the remote window responds.

So while is not absolutely necessary to use it, it can bridge the problems that can occur in a number of scenarios.

Clifton
Clifton
Site Admin
 
Posts: 732
Joined: Tue Jan 14, 2014 1:04 am

Re: tbfunction_pgExecuteRemote

Postby John Robin Dove » Sat Nov 18, 2023 2:51 pm

Right. I understand. Thank you.
John Robin Dove
 
Posts: 486
Joined: Thu Jan 23, 2014 4:35 am


Return to General Discussion

Who is online

Users browsing this forum: No registered users and 2 guests

cron