Sorry, I don't understand. What static call? What 'way below'?
And obviously it won't work if you don't include the GWT app in the page.

Ian

http://examples.roughian.com


2009/3/20 Vitali Lovich <[email protected]>

> Slight modification - why are you making it a static call?  What about the
> way below.
>
> Also, don't forget to include the nocache.js file in your HTML - it
> actually needs to be there statically (well - inserted onto the page before
> it finishes loading).
>
> On Thu, Mar 19, 2009 at 8:44 PM, Ian Bambury <[email protected]> wrote:
>
>> Something like this:
>>
>> package com.whatever.client;
>>
>> public class Main implements EntryPoint
>> {
>>     public void onModuleLoad()
>>     {
>>         createJsFunction();
>>     }
>>
>>     private native void createJsFunction()
>>     /*-{
>>         $wnd.jsToGWT = function(parm)
>>         {
>>             th...@com.
>>  whatever.client.Main::gwtMethod(Ljava/lang/String;)(parm);
>>         };
>>     }-*/;
>>
>>     @SuppressWarnings("unused")
>>     protected void gwtMethod(String parm)
>>     {
>>         RootPanel.get().add(new Label(parm));
>>     }
>> }
>>
>> and then you can test with this
>>
>>     <a href=# onclick="javascript:jsToGWT('Hi!')">Click</a>
>>
>> in the html
>>
>> Ian
>>
>> http://examples.roughian.com
>>
>>
>> 2009/3/20 markmac <[email protected]>
>>
>>>
>>> Hi Ian,
>>>
>>> That sounds like a good idea, dont know why i didnt think of that...
>>> nice one!
>>>
>>> Im assuming you mean that I need to define a JSNI method in my GWT
>>> code, that my own custom client code calls to invoke the insertion of
>>> the widget on to the page?
>>>
>>> thanks for the thoughts!
>>
>>
>>
>>
>
> >
>

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