Asynchronous loading

9 views
Skip to first unread message

grigoresculiviu

unread,
Dec 28, 2011, 7:23:13 AM12/28/11
to Java2Script
Hi,

Is there a way to know when all classes have been loaded by j2s?

I tried the onload() callback in j2s.lib but doesn't work as the
classes seem to be still uninitialized.
When I call below alert(wm.common.GlobVar.versionNo) it reports 'wm'
is not found.

window["j2s.lib"] = {
/*base : "http://archive.java2script.org/",*/
base : "../j2s/",
/*alias : "2.0.0",*/
alias : "j2slib",
version : "20081203",
/*forward : true,*/
mode : "dailybuild",
onload : function () {
var j2sBase = window["j2s.lib"].j2sBase;
ClazzLoader.packageClasspath ("java", j2sBase, true);
ClazzLoader.setPrimaryFolder ("../binjs");
ClazzLoader.packageClasspath (["wm.client.core"], "../binjs/");

ClazzLoader.loadClass ("wm.common.GlobVar");

alert(wm.common.GlobVar.versionNo);
}
};


Any suggestion would be much appreciated.

Regards,
Liviu

Zhou Renjian

unread,
Dec 28, 2011, 7:50:23 AM12/28/11
to java2...@googlegroups.com
Try 

ClazzLoader.loadClass ("wm.common.GlobVar", function () {
    alert(wm.common.GlobVar.versionNo);
});

Regards,
Zhou Renjian




--
You received this message because you are subscribed to the Google Groups "Java2Script" group.
To post to this group, send email to java2...@googlegroups.com.
To unsubscribe from this group, send email to java2script...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/java2script?hl=en.


Reply all
Reply to author
Forward
0 new messages