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
-~----------~----~----~----~------~----~------~--~---

Reply via email to