How to define and read Global JavaScript Variable in GWT

2010-02-10 Thread Ashish Khivesara
Is there a way to define a global javascript variable in GWT? I was able to define one in a sample.js file and then read the same using a JSNI native method. But was wondering if there is a way to this purely in Java (GWT) . My goal is to be able to have a global object that can be shared between

Re: How to define and read Global JavaScript Variable in GWT

2010-02-10 Thread Ashish Khivesara
In Java we would define static variables to do something like this. Is that the correct approach I can take here as well? thanks On Wed, Feb 10, 2010 at 11:51 AM, Ashish Khivesara < ashish.khives...@gmail.com> wrote: > Is there a way to define a global javascript variable in GWT? > I was able to

Re: How to define and read Global JavaScript Variable in GWT

2010-02-11 Thread obesga
Look at http://code.google.com/intl/en/webtoolkit/doc/latest/DevGuideCodingBasicsJSNI.html But, into GWT, you can define a static variable in one class, it'll work as expected There are no 'global variables' in Java, but you can do /*** Example 1 ***/ class MyModule{ // Defi

Re: How to define and read Global JavaScript Variable in GWT

2010-02-11 Thread Ashish Khivesara
Great. Thanks a lot for the confirmation and examples. On Thu, Feb 11, 2010 at 5:45 AM, obesga wrote: > Look at > > > http://code.google.com/intl/en/webtoolkit/doc/latest/DevGuideCodingBasicsJSNI.html > > But, into GWT, you can define a static variable in one class, it'll > work as expected > >