Sometimes we use javascript to manipulate XOJO objects in the browser.
Like moving the controls freely using drag and drop via jQuery.
But there is no way to update the parameters ( e.g. : location ) to the
backend server. So whenever the parameter is updated, it will return to the value last
maintained by the backend server. I utilize JavaScriptError event
to return values from the webpage to the backend server but this is not supposed to be handled like this.
Can we have an event like MessageFromJavascript / JavascriptMessage / or whatever suitable
to allow this? It will simplify development greatly without having to resort to WebSDK etc.
about Javascript
maybe you can use the Fetch API, a method called fetch can send data to backend.
for input forms there is FormData helpful.
and have a look at JavaScript HTML Document Object Model (DOM)
If you need a quick way to track the movement of say, 15 instances of 10 different types
of container controls in a single web page, it would be quite cumbersome to implement
them as Web Sdk controls. I have about 20 unique container controls and encapsulating them
as Web Sdk control at this stage is not feasible.
Xojo has an identical implementation (the JavaScript Error event.) I though you might just be able to duplicate one for non-error related notification.
But anyway its a feature request. I can live with the hack for now.
Please keep up with the good work and i look forward to Release 3.
But you don’t need one sdk control per container. You could have a single control per page that you use for transmitting data about all of the controls. The WebSDK has a super easy mechanism for transmitting data from the page and having it fire an event in a control already. All you’d need to do is create a json string that contained the controlID and the new position and size. When you get the event, you find the control by the controlID and set its values.
But hey, what could the guy who created the WebSDK (that’s me) and the guy who’s now maintaining the web framework (Ricardo) possibly know about the easiest way to solve your problem…
Just FYI - what I just described is in fact one of the WebSDK examplefiles. Look in the Extras folder next to the IDE, there’s a folder called WebSDK and another inside called Examples. The project you’re looking for is called “Callback Example”