Is the triggerServerEvent() method documented in WebSDK actually implemented yet?
I’ve been trying to use it and while there are no complaints from the sample JS I’ve written, nothing ever triggers the ExecuteEvent() event in the WebSDKUIControl.
My line is essentially:
this.triggerServerEvent("pressed", null, false);
And from the docs and TypeScript definitions file, I would have assumed that I would at least have had a populated [name] argument in the server side event, but nothing fires. I’ve also included an alert() in the click of the DOM element that I’m using for testing, and that fires fine, so I know that the control is reacting to my mouse clicks.
Does your control have a Pressed event definition and is it implemented on the control on a webpage?
Yes to both, it has the definition.
I’f created the event definition in the control and implemented it in an instance of the control on the web-page, but I’m not even getting a raising of ExecuteEvent(), which I am guessing is the first stage.
Sending events (the parameter passed to the constructor) to the screen using an alert() also shows that it is included in the list if that makes any difference.
You can put this on hold for the moment Greg - I have managed to get the event firing in the constructor, just not in the click event so I need to look into it.
I have an idea of what is happening, I just can’t prove it just yet.
Looks like there is some weirdness with VSCode and TypeScript modifying the resulting JS code. The added control’s parent (a label on the WebControl) was not being addressed properly, so the call to the top level control’s triggerServerEvent() was not being made properly.