How to detect when all objects have rendered on browser

Is there any Xojo equivalent to the JS OnReady event? I have a web app which dynamically creates a bunch of ImageView controls, and populates them with pictures. The webpage (or container) shown event fires as expected, but the images might take a while longer to appear. I would prefer to keep the page hidden (or covered) until all the images have rendered, but can’t find any event that actually represents the rendered status of all objects. Any suggestions?

Problem is, WebPages are subsets of the Body element.

So you could use onLoad in body for the first page, but not subsequent ones.

1 Like

The Shown event on a page should fire after all of the controls are drawn, but that doesn’t include fetching pictures.

You could use the WebSDK and create a controller that your image viewer controls would notify when they’re done and then it would send the final “everything’s ready” event to the server.

Thanks for the suggestions guys. I seem to have found a workaround which works quite well. It seems that the Shown event of each WebImageView control appears to correspond quite well with the browser rendering. Since my code already knows exactly how many images are to be sent to the browser, I can setup a counter which is updated by each Shown event. I then have a WebTimer to periodically check in with the counter. Once the count reaches the known value, I can remove the ProgressWheel etc - and yes, even on a slow internet connection. the PW is cleared at approx the same time as the last picture is rendered. :+1: