Re: Working with JSNI $wnd

2009-09-28 Thread David
Hi, First of all instead of using eval you could use: $wnd[canvasname] that is a much cleaner way of getting to the variable. Secondly the problem is with you callback not working is because you should call this method on this. Now because you invoke it from an anonymous JS function, the context

Re: Working with JSNI $wnd

2009-09-25 Thread Steven De Groote
@Thomas Broyer: Both solutions work for retrieving the cnv object, but I still can't call the submitDoneInternal() ... Any ideas welcome! Steven On Sep 25, 4:17 pm, Thomas Broyer wrote: > On 25 sep, 13:08, Paul Robinson wrote: > > > Does this work: > >     var cnv = eval("$wnd." + canvasname

Re: Working with JSNI $wnd

2009-09-25 Thread Thomas Broyer
On 25 sep, 13:08, Paul Robinson wrote: > Does this work: >     var cnv = eval("$wnd." + canvasname); argl! Please: var cnv = $wnd[canvasname]; --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Google Web Toolk

Re: Working with JSNI $wnd

2009-09-25 Thread Steven De Groote
Yep, thanks a lot Paul! Now the alert shows me: "Form object: [Canvas ID:cnv_fu1]" Looks good to me, until I try this: var myvar = c...@be.sofico.montelli.mmc.client.custom.widgets.upload.srafileupload::submitDoneInternal (Ljava/lang/String;)(filename); I do have this defined on SRAFileUpload th

Re: Working with JSNI $wnd

2009-09-25 Thread rudolf michael
OK.when you create a function in javascript with parameters then the function will look like function(var1, var2){}, you can use those variables by their name directly there is no need to use the $wnd with the variable name unless the variable is defined as global/outside the method scope {} Now i

Re: Working with JSNI $wnd

2009-09-25 Thread Paul Robinson
Does this work: var cnv = eval("$wnd." + canvasname); Steven De Groote wrote: > 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 n

Re: Working with JSNI $wnd

2009-09-25 Thread Steven De Groote
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 $w

Re: Working with JSNI $wnd

2009-09-25 Thread rudolf michael
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 var canvasname; Then you access it from anywhere you like using $wnd from native

Working with JSNI $wnd

2009-09-25 Thread Steven De Groote
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 + " - "