views:

119

answers:

1

In GWT is there a way for a widget to access a public member of the application's EntryPoint class? I want to store certain "application-wide" data in the EntryPoint class, and then have widgets access these fields and behave differently according on their values. In my mind it seems simple enough, but I just can't find the code for it anywhere...

+1  A: 

You don't need to store this data in the EntryPoint, you probably want to store this data in some common utility class and populate the data when the app loads.

Then just pass the object around to any widgets that need it. Or better yet, bind it in the Singleton scope using Google Gin to make it accessible anywhere in your app.

Jason Hall
Hmm ok that makes sense, thanks.
John J. Camilleri