Not sure how this works now that we are experimenting with “send event in batches”. And the async nature of web.
Maybe @Ricardo_Cruz can give us an idea.
I would open the browsers debug tools and see if you’re getting a JavaScript error somewhere. That’s the only thing I can think of that would cause it to only sometimes fire.
Every time something goes wrong, the debug tools are your best friend. Even when things seem Ok, the debug tools may show issues. Seems each browser implements its own set of features. Looks like having a standard implemented by all browsers developers is too much to ask fore.
there were no errors in the browser debugger, and definitely not related to my websdk’s
after a while I figured that the page (or dialog) shown event is fired before the webcontrols or websdks on the page
which leads me to this problem: how (and where in which event) do we know that all the controls of the page are shown ? I need this to fill values of the controls from a database. if the controls are not yet shown I fill values in nowhere and it leads to empty controls .
I managed to use a notifier class interface for every of my controls , that indicate “I’ve run the shown event’“ and the page or dialog can receive the notification and then only fill the controls with their values.
I still don’t understand why in the framework the shown event of the page is fired before the controls ?
I did not try because the different users of the website have very different link speed, so what value to set the timer to ? I prefered a method that tells the dialog or page each time all controls are really shown
IIRC, the built in controls store their values in properties in JavaScript even if the control hasn’t been rendered yet. In fact, the last thing the controls do after receiving an update from the server is to request an update from the framework.
I haven’t seen your code, but I would say then that you should make sure your WebSDK controls follow the same pattern of storing the data in properties, and don’t just push values into the DOM because the control may not be rendered yet. This gives you the added bonus of being able to tell if the value has been changed since it was sent from the server.