I'm afraid I lost you somewhere... Suppose I make a global var canvasname, what should I assign it to then? The problem is that this defineBridgeMethodSubmitDone() is static, while in the JS function I need to call a function on a specific object.
The name of the object is cnv_fu1, so I think $wnd.cnv_fu1 would return me my object. I do have that name in the variable canvasname, but I can't work out how to get my object. If you were pointing at something else, feel free to explain, I don't understand fully right now. Regards, Steven On Sep 25, 11:48 am, rudolf michael <[email protected]> wrote: > I guess that you have a scope problem. function(canvasname, filename) { > } > canvasname is not accessible from outside the method scope. In order to make > it global, you need to define in in your html header. > by addsing <script>var canvasname;</script> > > Then you access it from anywhere you like using $wnd from native GWT or by > its name if you wanna hit it from normal js code. > > regards, > ruds > > On Fri, Sep 25, 2009 at 12:41 PM, Steven De Groote <[email protected] > > > wrote: > > > Hi, > > > I'm struggling a bit with JSNI and would like your help. > > I have defined the following: > > > public static native void defineBridgeMethodSubmitDone() /*-{ > > $wnd.submitDone = function(canvasname, filename) { > > $wnd.alert("Upload done: " + canvasname + " - " + > > filename); > > var cnv = $wnd.canvasname; > > $wnd.alert("Form object: " + cnv); > > var myvar = > > c...@be.sofico.montelli.mmc.client.custom.widgets.upload.srafileupload > > ::submitDoneInternal > > (Ljava/lang/String;)(filename); > > $wnd.alert("Incoming: " + file + " Processed: " + > > form); > > } > > }-*/; > > > Here the canvasname is a string with value "cnv_fu1" > > I have checked with firebug, and there exists a $wnd.cnv_fu1 in my > > application. > > However, I cannot work out how to access this object. > > > "var cnv = $wnd.canvasname;" is not working as I think it doesn't take > > the value of canvasname, rather just the string "canvasname". > > > Does anyone know how to solve this itching issue? > > > Thanks, > > Steven --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en -~----------~----~----~----~------~----~------~--~---
