Thanks karim! Firebug is a great tool.
I have learned from it that my method is accessible from the html
where I am calling it from and the variable that I want included in
the call is being included, however there is still a problem.
According to firebug it looks like everything should be working fine,
but my java method is still not actually being executed. To me this
indicates a problem with the path provided by the exportMethod()
perhaps, but I have checked this many times and it seems to be
correct.
My methods are not static. I would prefer to leave them that way, but
I could possibly change them (the java method I need to call is
dependent on many other methods and variables that I would also need
to make static in order to use). I feel like this should work
regardless of whether or not the methods are static, but if someone
else can confirm what Paul said about the methods having to be static
I can try that.
Thanks everyone.
On Aug 9, 5:20 am, karim duran <
karim.du...@gmail.com> wrote:
> Hi ASlak,
>
> It should work. I already did that.
>
> Don't forget that, finally, all your java code will be translated in
> optimized javascript.
> I haven't enough element about your problem to really help you.
>
> So, here's my proposition.
>
> 1) build your application as you usually do
> 2) run it in firefox
> 3) install firebug, a firefox extension wich provide a javascript debuger
> with breakpoint management and step debuging
> 4) open tab "javascript" in firebug and set a breakpoint where your
> javascipt method is called
> 5) watch your variables, fields...etc...and try to analyse what is
> happening.
>
> I used this methodology to track some jsni method behaviour, difficult to
> debug, from the point of view of java.
>
> I hope it helps.
>
> Regards.
>
> Karim Duran
>
> 2011/8/8 ASlak <
alain.s...@gmail.com>
>
> > I have some code in my host html page that I would like to call one of
> > my java methods from.
>
> > The relevant part of the html looks like:
> > <script>
> > if(myCondition){
> > sendRequest(myVar);
> > }
> > </script>
>
> > I have a method in my java code for my gwt project that is called
> > sendRequest.
>
> > I am also using a method that looks like:
> > public native void exportMethod(myApp app)/*-{
> > $wnd.sendRequest =
> > $entry(a...@com.myCompany.myProject.client.myClass::sendRequest(Ljava/