blackberry / WebWorks-TabletOS

BlackBerry WebWorks for Tablet OS is a platform for building deeply integrated web applications for the BlackBerry PlayBook
http://us.blackberry.com/developers/tablet/webworks.jsp
Apache License 2.0
70 stars 14 forks source link

TypeError: error on xhr requests when registering callback param #49

Open cdelcol opened 12 years ago

cdelcol commented 12 years ago

These errors seem to happen with any WebWorks call that registers a callback parameter. For example, the following code works as expected:

blackberry.app.event.onSwipeDown(function() { alert("swipe down"); });

But produces an error like the following:

index.html:190 XHR finished loading: "webworks://blackberry/app/event/onSwipeDown?onClick=0". index.html:185 TypeError: 'null' is not an object (evaluating 'response.Response')

The behaviour is the same with the following functions:

blackberry.app.event.onForeground(cb); XHR finished loading: "webworks://blackberry/app/event/onForeground?onClick=2". index.html:185 TypeError: 'null' is not an object (evaluating 'response.Response')

blackberry.app.event.onBackground(cb); index.html:190 XHR finished loading: "webworks://blackberry/app/event/onBackground?onClick=1". index.html:185 TypeError: 'null' is not an object (evaluating 'response.Response')

Besides the errors in the log messages, we don't see any problems with functionality.

cdelcol commented 12 years ago

These errors appear to be related to improvements in 2.0 re: the caching of XMLHttpRequests performed via conditional GET. The PlayBook behaviour is completely valid, but has changed in some way between 1.0 and 2.0

avanderveen commented 12 years ago

This issue is likely the same as, or related to, this issue; for which there is a fix.