That's because GWT doesn't know you actually need the errorHandler name. It'll mangle it to improve performance when compiling (by minimizing the size of your javascript).
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, since it seems like you want to do the error handling in native Javascript (why?), you don't need the JSNI part. Same goes for the dataHandler. On Mon, Mar 16, 2009 at 3:20 AM, dean.mikel <[email protected]> wrote: > > I'm attempting to use html5 db from my gwt application. I'm able to > open/create a database, and insert data in the table, but I cannot > read data from table. I can't get the data handler callback to work. > I am running this in Web mode (because the db won't be available in > hosted mode). Safari script debugger shows an error stating > dataHandler and errorHandler can't be found. > > I have something similar to this snippet of code: > > public void Read( JavaScriptObject db ){ > getData( db ); > } > > > private native void getData( JavaScriptObject db ) /*-{ > db.transaction > ( > function ( transaction ) { > transaction.executeSql("SELECT * from people';", > [], dataHandler, errorHandler ); > } > ); > }-*/; > > > public native void dataHandler( JavaScriptObject transaction, > JavaScriptObject results )/*-{ > var string = "Data contains: \n\n"; > for (var i=0; i<results.rows.length; i++) { > var row = results.rows.item(i); > string = string + row['name'] + '\n'; > } > $wnd.alert(string); > }-*/; > > public native static void errorHandler( JavaScriptObject transaction, > JavaScriptObject results )/*-{ > $wnd.alert('DB Error: ' + error.message + ' (ErrorCode: ' + > error.code + ')' ); > }-*/; > > > Any help would be greatly appreciated. > Thanks, > Dean Mikel > > > > > > --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
