开发者

Access public EntryPoint fields in GWT

开发者 https://www.devze.com 2022-12-23 07:17 出处:网络
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 ac

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 sim开发者_运维知识库ple enough, but I just can't find the code for it anywhere...


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消