Yeah ok I see what you did, that removes the need for the static call
like its stated in the Google GWT Doco.

Now it looks like everything is firing, but there is nothing, at all,
inside the jsToGWT function body (according to FireBug anyway). So
nothing at all happens when I call jsToGWT...

any thoughts?

On Mar 20, 1:03 pm, Vitali Lovich <vlov...@gmail.com> wrote:
> Sorry - if you use gmail, you'll have to open the quoted text (that's where
> I made the change).
>
> On Thu, Mar 19, 2009 at 10:00 PM, markmac <mark.macum...@gmail.com> wrote:
>
> > I think he means the call to createJsFunction() and gwtMethod() which
> > are both static, BTW, I found this in the GWT Doco:
>
> >http://code.google.com/docreader/#p=google-web-toolkit-doc-1-5&s=goog...
>
> > which shows how to avoid the need for static calls...
>
> > I have tried getting this to work, but I see, to have some trouble
> > calling the window.jsToGWT method, its giving me the error "this
> > $static is null" you ever seen this?
>
> > On Mar 20, 11:54 am, Ian Bambury <ianbamb...@gmail.com> wrote:
> > > 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 <vlov...@gmail.com>
>
> > > > 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 <ianbamb...@gmail.com>
> > 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 <mark.macum...@gmail.com>
>
> > > >>> 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 Google-Web-Toolkit@googlegroups.com
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to