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
Highlighted
Regular Contributor
Posts: 55
Registered: ‎10-31-2012
My Device: Blackberry 10 Dev Alpha Simulator - VMware
My Carrier: (none)

How to I set the base url correctly for a Blackberry Cascades 10 Beta 3 SDK WebView?

how do I set the base url correctly for a Blackberry Cascades 10 Beta 3 SDK WebView (I am using the Blackberry 10 Dev Alpha Simulator)? I'm trying to figure out it, and I have made a pretty basic app trying to figure it out. I put a picture of a red circle under a folder called webViewContent that I put under the assets folder in the QNX Momentics IDE. I called the picture redCircle.png, and I am trying to see if I can figure out how to set the base url of a webview correctly by trying to access that red circle.

There is a class bb::cascades::WebView for a webview and I am using a function, setHtml(html, baseUrl);

I have been trying various variations. My html is:

QString html = "This is a test

";

and for my base url I am using:

QUrl baseUrl = QUrl(QDir::currentPath() + "/app/native/assets/webViewContent/index.html");

I should be seeing the red circle, but I am just seeing an image with a "?", where it should be showing the red circle.

So it seems I am not setting the base url correctly.