Sorry for the long rambling post, but I’ve spent far too many hours trying to get this to work and I’m about to switch my website over to FORTRAN.
I’m getting intermittent BDOD (Black Dialog of Death) errors that seem to be related to code I have for filling WebListBoxes and WebPopupMenus. The errors are almost always like this:
Could not execute returned javascript: undefined is not an object (evaluating 'Xojo.controls['Ruxvp12i'].refresh')
I have a listbox embedded in a WebContainer, which itself is embedded in another web container. I instantiate these at runtime, like this:
newPageContainer = New somethingsomething // where somethingsomething is a web container
newPageContainer.EmbedWithin(self, x,y, w, h)
newPageContainer.Visible = true
This is not the way I had it originally; originally I put all the containers on the page in the IDE and just manipulated their visibility. That caused many, many more BDOD errors, so I started doing it this way.
Because the code execution path never changes yet the errors only happen every so often, I believe this is a timing issue related to the existence of a control on the page.
So my question is: when, exactly, is it safe to do things like fill a listbox or a popup? I had been doing it in the Shown event of the relevant object (i.e. the Shown event of a listbox fills the listbox).
In a hierarchy of web controls (including containers), does the outermost “Shown” fire first, or the innermost? I’m ok refactoring all the code to put the listbox filling and other initializing somewhere else, if someone can tell me what the right place really is.
I have seen others (such as @Bob Keeney ) suggest using a timer to fill these, but that seems like a poor workaround for what ought to be classified as a bug.
Oh, and just “one more thing”: the BDOD often (but not always) appears BEHIND the WebContainers, so it’s impossible to read it or click on either of its buttons. This also seems like not a Good Thing.
Suggestions are welcome. Thanks!