Static variable in runasync feature GWT

5 views
Skip to first unread message

Ghostcoder

unread,
Apr 9, 2009, 6:34:27 PM4/9/09
to Google Web Toolkit
I have a doubt

GWT.runAsync(new RunAsyncCallback() {
public void onFailure(Throwable err) {
}

public void onSuccess() {

some static method (method is a huge chunk of
code)

}
});

Will the static method javascript be downloaded when the application
starts or when the code reaches the point ?

How does static variables and methods behave in runasync feature ?

Thank you

Vitali Lovich

unread,
Apr 9, 2009, 6:38:46 PM4/9/09
to Google-We...@googlegroups.com
Code referenced outside of the runAsync callback will be brought in on startup.  If you only refer to that static function in the runAsync part (or in code brought in as a result) then it'll be downloaded in the background as expected.

You can use the SOYC tool to figure out exactly what's going on.
Reply all
Reply to author
Forward
0 new messages