Why can't I add a web dialog to a module?

I am trying to create a module and that module needs a web dialog object.
I tried putting one in the module but it won’t go.
Why not?

[quote]Understanding Modules
A module is a collection of project items, usually methods properties and constants. But a module can also contain other project items such as classes or even other modules. In fact, modules can pretty much contain anything except Windows and Container Controls.[/quote]

Seems WebDialogs/WebPages would follow the same rules as windows on the desktop.

hmm… I guess I just don’t understand what the limitation is or the rational for not being able to include a dialog box.

I think it would be pretty sweet if we could do that. Could be very useful for 3rd party solutions.

I don’t know what the limitation is but it must be a significant one. Perhaps Norman or other Xojo dev can chime in on this.

[quote=62247:@Brian O’Brien]I am trying to create a module and that module needs a web dialog object.
I tried putting one in the module but it won’t go.
Why not?[/quote]
Because its not allowed :slight_smile:

In my case the module supplies a thread that updates a web dialog box.
It would be nice that every time I use this module that I get both the class and the dialog.

Threads should NOT update UI …. just FYI

Who else would update a web modal dialog?

A thread should NOT do it directly
There’s many threads on the forums about this
The “rules” for desktop apply here as well

Yes… Including this thread:

Thread updating a web modal dialog

Use a timer that reads data from the thread to update your UI

Or dont - but when I breaks its not a bug and someone will say “I told you so”

You know I just don’t know who to believe anymore…
This thread stuff is going to be the death of me.
UML Sequence Diagram, Updateing a UI from an async shell (or thread)

When you have several, nay ALL, the engineers say “don’t update your UI from a thread” you might take heed.
If not you do so at your own peril - but when I breaks its not a bug and someone will say “I told you so”

[quote=62293:@Brian O’Brien]You know I just don’t know who to believe anymore…
[/quote]

In the link you posted, everyone is telling you not to update the UI from your own threads. Pretty consistent message…

Except for me. I suggested that the problems related to the Desktop and UI did not apply in the Web realm, because the mechanism is vastly different. Other than having more than one thread try to update the same session’s UI, I fail to see where the problem is in a single thread sending updates to the browser, especially since the framework itself is updating the UI from a thread, anyway.

IIRC, in Web Edition B.G. (Before Greg), this is essentially how events would get sent out of order, causing Javascript errors in the browser. Greg did a whole lot of work serializing all the events. I’d imagine that involved something like setting up event queues, and posting to those queues rather than directly sending Javascript out. But I have a wild imagination, so it might be a lot different.

Different yes - still a bad idea for many of the same reasons though

Seriously - ask greg
I did before I replied & he said (roughly) “it might not cause problems in the exact same way but it still can so its not recommended. Do it the same way as the desktop and it won’t”

So despite this thread being about adding a web modal dialog box to a module…

Updating a UI from a shell’s data available or completed event is Ok?

As I’m never sure I usually just queue these and add a timer to service these.

Which won’t work :slight_smile:
There are several spots like this (or putting windows into modules etc) that would be great to fix s other make more sense.
But right now there are issues with this in several spots in file i/o code, project model code etc.
Hence why its not supported.

[quote=62325:@Brian O’Brien]Updating a UI from a shell’s data available or completed event is Ok?
As I’m never sure I usually just queue these and add a timer to service these.[/quote]
To the best of my knowledge those are serviced on the main event loop so yes they should be OK

I stand corrected. Thank you.