Web1.0 Problem LoadLibraries only works on Open event

Hello, the following problem I created a WebControlWrapper in Xojo2019r3.2. Here I can call Java code in the Open event. If I then call it externally using the button I get the following error message. Attached is also the program. Maybe someone knows a solution to the problem?

Babylon2019.xojo_binary_project

My suggestion would be to read the WebSDK documentation. LoadLibraries is for the SetupJavascriptFramework event. Check in your install folder for /Extras/WebSDK/. Inside there you’ll find the documentation and examples.

2 Likes

As Tim mentioned, LoadLibraries has to be called when WebSDK controls are being initialized, even before the session has spun up for the user. The reason is that external libraries are added to the HEAD tag of the initial volley of data sent to the browser.

Hello, I have now managed it with triggerServerEvent. I also get a response in the ExceuteEvent. I receive a string as soon as I create a cube:

"Name: test1234, isInstance: YES, # of submeshes: 1, n vertices: 24, parent: NONE"

However, I would expect some kind of object ID or handle. or do you always get some kind of array back with js? If so, how can I pass this?

if me.ControlAvailableInBrowser then
  
  var exec() as string
  exec.AddRow(mesh+".position.x = '"+x.totext+"';")
  me.ExecuteJavaScript(string.FromArray( exec, EndOfLine ))
  
end if

Here I get the following error message: