Welcome!

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

Reply
Regular Contributor
JohnQtQml
Posts: 55
Registered: ‎10-31-2012
My Device: Blackberry 10 Dev Alpha Simulator - VMware

Getting an incorrect permissions screen in the webview Blackberry 10 Cascades Beta 3 SDK in Dev Alpha Simulator

[ Edited ]

I am trying to make dynamically generated html 5 graphs show up in a webview in Blackberry 10 Cascades. I have confirmed the html5 that I have generated, draws the correct graphs. My problem is that when I try to implement this in the Blackberry 10 Cascades Beta 3 SDK (using the Blackberry 10 Dev Alpha Simulator), the webview that is supposed to show the graph, just looks like this:

Error: This file could not be opened. Check that you have the correct permissions and try again.

Here is the code that leads to this error:

 

    //html_ already contains the html-5 code to make the graph at this point in the code

    //This is the file path to a local file that is actually accessable in the emulator
    //and not just from Windows
    //

    QFile *chartFile = new QFile("app/native/assets/data/chart.html");

    if (chartFile->open(QIODevice::WriteOnly)) {
        chartFile->write(html_.toUtf8());
        chartFile->flush();
        chartFile->close();
    }

    if (chartFile) delete chartFile;

    if (graphView_) {
        graphView_->setHtml("");
        graphView_->setUrl(QUrl::fromLocalFile("app/native/assets/data/chart.html"));
    }

 

I checked the permissions of that file, put they are all Allow (777 permissions for those who know Unix style permissions).

I added access_internet to the bar-descriptor.xml, eventhough my app was already able to access remote sites, just to see if that would fix it, but it did not.

I've been searching around trying to find a solution to this problem, but I have not.

If anyone could help me out with this, it would be greatly appreciated.

Please use plain text.
Regular Contributor
JohnQtQml
Posts: 55
Registered: ‎10-31-2012
My Device: Blackberry 10 Dev Alpha Simulator - VMware

Re: Getting an incorrect permissions screen in the webview Blackberry 10 Cascades Beta 3 SDK in Dev Alpha Simulator

I could try setting the html directly, but there is a problem with that...

 

The problem with setting the html directly is that I am using a third party javascript library to generate the html-5 graph, and that javascript has to be referenced with a relative path. But if I set the html directly, I do not know where to make that path relative to.

 

Would anyone know the answer to that?

Please use plain text.
Regular Contributor
JohnQtQml
Posts: 55
Registered: ‎10-31-2012
My Device: Blackberry 10 Dev Alpha Simulator - VMware

Re: Getting an incorrect permissions screen in the webview Blackberry 10 Cascades Beta 3 SDK in Dev Alpha Simulator

Update:

I changed the code to set the html directly, now I have this:

 

if(graphView_){
    graphView_->setHtml(html_,QUrl("app/native/assets/data/chart.html"));

}

 

But nothing shows. It seems I have the wrong relative path relative to my base url.

My base url is this: QUrl("app/native/assets/data/chart.html")

My relative paths all begin with: ./Highcharts/js/...

My relative paths are located under: app/native/assets/data/Highcharts/js

It seems to me that I this should work, but when I do this, I just a blank screen, as if it cannot find my relative paths. So I don't know what's going on here either.

Please use plain text.