IMPORTANT:
- The BlackBerry browser implementation that PhoneGap uses for BlackBerry OS 4.6 and 4.7 supports only DOM level 2 and CSS level 2. Due to this constraint, most popular JavaScript frameworks (jQuery, XUI, etc.) do not work on PhoneGap BlackBerry. RIM has announced a WebKit-based browser to replace their current implementation, which should fix many of these issues, but this is slated for release sometime in 2010, so we've still got a bit of time to wait...
- Native XHRs do not work on PhoneGap BlackBerry. You can have a look at the Java-based, native implementation of XHR that we've implemented here: http://github.com/phonegap/phonegap/blob/master/blackberry/src/com/nitobi/phonegap/api/impl/NetworkCommand.java
The JavaScript interface looks like this:
navigator.network.XHR(url, postData, callback);
url - string parameter of the URL to send the request to.
postData - string parameter of POST data to send (can be null if you don't want to send POST - just add GET parameters as querystring to the URL parameter if that's the case).
callback - a function handle to execute when the XHR returns.
BlackBerry JDE 4.6.1
- The 'onkeyup' event does not work properly. Only tested with <input> elements.
- NOTE: This is *not* an issue on the simulator, but is on a BlackBerry (Bold) device. Adding an event handler to a node, and then using this.<attribute> to grab the node's state from within the event handler returns the attribute of the node *prior* to the event being dispatched. Hard to explain, here's an example:
var check = document.createElement("input");
check.setAttribute("type", "checkbox");
check.addEventListener("click",function() {
if (this.checked) { alert('checked!'); else { alert('unchecked!'); }
, false);
With the above example, we create a checkbox element and assign a click handler to it that alerts the state of the checkbox. Expected behaviour is that after you check the box, an alert saying 'checked!' is displayed. Instead, when you UNCHECK the box, the 'checked!' alert is displayed and when you check the box, the 'unchecked!' alert is displayed.
BlackBerry JDE 5.0 (Current in beta)
Not there yet ;)
Comments (2)
Brian said
at 11:00 am on Nov 9, 2009
Any updates on the XMLHttpReuest() issues?
Fil Maj said
at 2:44 pm on Nov 9, 2009
Hey Brian,
I've added a bit more information on how to use our own Java-based implementation of the XHR, and how to call it from JavaScript. Hope that helps you out,
Fil Maj
Web Software Engineer
Nitobi
You don't have permission to comment on this page.