Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Native Development

Thank you for visiting the BlackBerry Support Community Forums.

BlackBerry will be closing the BlackBerry Support Community Forums Device Forums on April 1st (Developers, see below)

BlackBerry remains committed to providing excellent customer support to our customers. We are delighted to direct you to the CrackBerry Forums, a well-established and thorough support channel, for continued BlackBerry support. Please visit http://forums.crackberry.com or http://crackberry.com/ask. You can also continue to visit BlackBerry Support or the BlackBerry Knowledge Base for official support options available for your BlackBerry Smartphone.

"When we launched CrackBerry.com 10 years ago, we set out to make it a fun and useful destination where BlackBerry Smartphone owners could share their excitement and learn to unleash the full potential of their BlackBerry. A decade later, the CrackBerry community is as active and passionate as ever and I know our knowledgeable members and volunteers will be excited to welcome and assist more BlackBerry owners with their questions."

- Kevin Michaluk, Founder, CrackBerry.com

Developers, for more information about the BlackBerry Developer Community please review Join the Conversation on the BlackBerry Developer Community Forums found on Inside BlackBerry.

New Contributor
Posts: 2
Registered: ‎12-17-2012
My Device: BB10 Dev Aplha
My Carrier: tim

Re: Method for making an HTTP style request in Cascades/QML?

i just tested it and that works...


in main.qml add


import "ajax.js" as A

then add A.get()


    onCreationCompleted: {
        // this slot is called when declarative scene is created
        // write post creation initialization here
        console.log("!!!!!!!!!!TabbedPane - onCreationCompleted()")

        // enable layout to adapt to the device rotation
        // don't forget to enable screen rotation in bar-bescriptor.xml (Application->Orientation->Auto-orient)
        OrientationSupport.supportedDisplayOrientation = SupportedDisplayOrientation.All;



add ajax js


function get(url) {
    var xhr = new XMLHttpRequest();
    xhr.onreadystatechange = function()    {
        if ( xhr.readyState == xhr.DONE)        {
            if ( xhr.status == 200)            {
                var rt=xhr.responseText;

New Contributor
Posts: 8
Registered: ‎07-20-2013
My Device: BB Z10, BB Q10
My Carrier: Vodafone

Re: Method for making an HTTP style request in Cascades/QML?

Hi Solom,

This worked for me very good with some modifications to be compatible with the new firmware changes

But I have a little problem here, that when I tried to run the app the main qml is not started well and it keep displaying the Black Berry 10 black screen

So please would you help me to find the mistake.

Here under is my code.




 * Copyright (c) 2011-2012 Research In Motion Limited.
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * http://www.apache.org/licenses/LICENSE-2.0
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * See the License for the specific language governing permissions and
 * limitations under the License.

#include <bb/cascades/Application>
#include <bb/cascades/NavigationPane>

#include "app.hpp"

using ::bb::cascades::Application;

Q_DECL_EXPORT int main(int argc, char** argv)
    Application app(argc, argv);

    App mainApp;

    return Application::exec();

 This is the only file that you didn't provide in your code.

The problem here that when you create a new project in the latest NDK, by defualt the App.hpp and App.cpp are named "applicatioui.hpp" and "applicationui.cpp"


Thanks in  advance for your previous kind help Smiley Wink