On Mon, Mar 16, 2009 at 5:12 PM, dean.mikel <[email protected]> wrote:

>
> Thanks very much for the response.
> >What you need to do is instead of giving it errorHandler, pass it a
> > Javascript function you create (on every call or cached in the page
> > somewhere) which then calls your Java code using JSNI although
>
> Ok, so I could use a closure anonymous function in place of the
> callback arguments. Then inside the closure I would
> would use JSNI to call my java dataHandler method? I'd have to process
> the callback parameters inside the closure, for example to convert the
> result set to array, because Java side won't understand SQLResultset
> type, correct? Or is there a better way?

Yup - that's the word I was looking for.  Closure.  Well, you see, it's kind
of pointless to use a closure to just wrap a call to dataHandler.  You could
just pass in dataHandler (using JSNI).  The cleaner approach (as far as I
know, and somebody feel free to correct me), would be to write an overlay
type for SQLResultSet (an extension class of JavascriptObject that uses JSNI
to retrieve values - a google search should give you a nice overview).

Then you pass in your dataHandler via JSNI, but make it a non-native method
that accepts your overlay.


>
>

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