Two-way syncronous communication Xojo WebControls-DOM Javascript on Iframe (or directly)

I need syncronous two-way communication between javascript input / labels located in a webcontrolwrapper, and webcontrols of webpage loaded from webcontrolwrapper HTML code, on an iframe.

I know that for these things need to create custom classes, but still do not know personalize them. Where I can get a similar example? At least I can display information synchronously to the webpage contained in the iframe? And if it were only a webcontrol a webpage? I have observed that not synchronously displays the information to the javascript side. Thanks.

Remember whats in the browser may be far removed from the server where your web app is running
Javascript runs in the users browser
Xojo code is running on the server
Any latency or connectivity issues between the two will give you headaches with such a set up

[quote=293211:@Manuel Salguero]I need syncronous two-way communication between javascript input / labels located in a webcontrolwrapper, and webcontrols of webpage loaded from webcontrolwrapper HTML code, on an iframe.

I know that for these things need to create custom classes, but still do not know personalize them. Where I can get a similar example? At least I can display information synchronously to the webpage contained in the iframe? And if it were only a webcontrol a webpage? I have observed that not synchronously displays the information to the javascript side. Thanks.[/quote]
There is no synchronous mode with web apps. When you write code on the server in a method or event, all of those instructions are queued up and then sent back to the browser when your code ends. Once that happens, an event fires on the browser, all of those responses are executed and then messages are sent back to the server to fire events again… to run your Xojo code.

Rather than trying to shoehorn Xojo to work synchronously, I suggest that you rethink your strategy to work asynchronously.

Norman, Greg, I understand that the web works asynchronously, but I need a screen information before completing a process that triggers sending information to the browser refresh. I really do not need to work completely synchronously, only display information that changes state when it is running a process to completion.

How I can force the trigger to display information in the browser in a middle of a process?

I would welcome an example to refresh from Xojo to Javascript, and viceversa. Well, from Javascript I already use the Xojo.triggerServerEvent function, but on the contrary do not know how to do, and how to fire it…

Thank you.

Put your processing code in a web thread and use a web timer to send updates to the browser.

But how do I send this update? what command sentence after ExecuteJavascript?

And if I use a WebTimer, WebTimer sends an update without additional code? What I insert in the Action Method?

My problem is understanding for when this update occurs, and how Xojo the causes. Thanks.

The update is sent in the Action event of the WebTimer.

Thanks Greg :slight_smile: