New control WebSDKUIControl

I’m creating a small control with an example div where clicking on the div should return the event to xojo but it doesn’t work.

I am attaching the example file someone can explain to me why.

sample project:

you have a lot of events missing from your control
serialize, …
see the websdk examples you still have a lot of work !

in the sessionhead event you should only tell the external frameworks you need to use
most of the time this is empty.
the executeevent is what you should execute from the browser side, using the triggerServerEvent function.

the really strange thing that even if the control is visible it is not seen by the xojo framework with the command: XojoWeb.getNamedControl(‘controlid’)

shown in the photo:

as if the generated control was outside the xojo framework, do I have to indicate the control in some javascript?

in sessionjavascripturl event the main code, and in serialize event the parameters of your control

so the print code must be inserted into a javascript file can no longer be written arguments in html?

The WebSDK controls are more structured in Web 2.0 than in v1, mostly because we got so many requests that our controls be made the same way as yours.

if i print a div with an id generator from xojo how can i tell xojosdk that that id is part of the framework?

could you kindly give me an example of how to create a div and associate the click of the div button to return to xojo?

Xojo/Extras/WebSDK/Examples/Callback Example.xojo_binary_project

I have already seen this example, but it uses 2 objects, one to print the button code and the other to process it, I wanted to understand if it could be done with a single object.!

You can’t. You must create both the Xojo and the corresponding JavaScript object for everything to work correctly.

Forum for Xojo Programming Language and IDE. Copyright © 2021 Xojo, Inc.