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