Joe, You don't need DOM events, per se. Use Observer Pattern. Your Login module doesn't need to know who's subscribed. It just needs to implement the Observable interface (register listeners, fire login state change events). Your other modules are in fact dependent upon Login. They need to know how to register listeners, receive events, recognize Login events, and then I would suggest you let them probe the Login module directly for login state.
If you look at how ChangeListener and SourcesChangeEvents work in GWT, there are all the elements of the Observer pattern you need, and you can copy that. Walden On Nov 3, 3:33 pm, JEA <[EMAIL PROTECTED]> wrote: > I have a web site that has pages that each can contain a variety of > independent apps embedded in a different positions within an otherwise > conventional HTML page. Although independent, they can affect one > another. For example, there is a login box that authenticates a > user. Based on the user login status, the other apps may appear or > disappear or change their behavior. Since a user can log in or out at > any time, the apps should be able to detect the change when it happens > and modify their behavior appropriately. The login box doesn't know > what other apps are on the page so it can notify them directly. I > didn't code all the apps as part of one large app because I didn't > want them all to load for every page when only a small subset would be > visible. > > My plan was to create some type of shared bulletin board object (maybe > a hidden div with custom attributes set) on which the login box would > post changes to the login status then fire a DOM event to notify > anyone who cares. The other apps would register listeners to receive > the change event and check for the status changes by looking at the > bulletin board, adjusting their behavior appropriately. > > Problem is, I can't figure out how to implement this. I can see I can > use eventPreview to process a DOM event but I don't see a method that > lets a GWT module programatically fire an event on a DOM element. > > Is this possible in GWT or GWT-ext? Perhaps there is an altogether > different and better way to achieve my intended effect. > > -Joe --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/Google-Web-Toolkit?hl=en -~----------~----~----~----~------~----~------~--~---
