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
New Contributor
Posts: 2
Registered: ‎05-09-2012
My Device: Blackberry 9300
My Carrier: orange
Accepted Solution

Cascades WebView Control

Hi,

 

I want to load a webpage into a WebView control. I create the WebView, set the url and finally add the WebView to the container but nothing appear.

 

Am I missing something?

 

Thanks

 

Developer
Posts: 350
Registered: ‎01-21-2011
My Device: Curve 8900 (Personal) / Bold 9650 (Work)
My Carrier: Regional

Re: Cascades WebView Control

Can you share the code you are trying to use? If you need just change the URL.

 

Here's some sample code:

 

Page {
    content: Container {
        layout: StackLayout {
            layoutDirection: LayoutDirection.TopToBottom
        }
        scrollMode: ScrollMode.Both
        WebView {
            url: "http://www.google.com"
        }
    }
}

 

Developer
Posts: 1,006
Registered: ‎05-22-2009
My Device: Not Specified

Re: Cascades WebView Control

[ Edited ]

I tried addding web view like this

Page* root = new Page;
    Container* container = Container::create()
            .preferredSize(1024, 600)
            .scrollMode(ScrollMode::Horizontal)
            .layout(new StackLayout());


Container* container2 = Container::create() .preferredSize(1024, 400) .scrollMode(ScrollMode::Both) .layout(new StackLayout()); WebView *web = new WebView(container2); web->setUrl(QUrl("http:www.google.com"));


container->add(container2);
root->setContent(container);
Application::setScene(root);


 But While building project ,I am not getting any errors,But I am not getting any web view loaded.

 

Regards

Rakesh Shankar.P

New Contributor
Posts: 8
Registered: ‎03-06-2012
My Device: Playbook, 9900
My Carrier: Telenor

Re: Cascades WebView Control

[ Edited ]

The webview in the current verison of cascades does only render a white page on the simulator. 

 

From the releasenotes;

The Cascades UI component WebView does not render on the BlackBerry 10 Dev Alpha Simulator. If a Cascades UI uses the WebView component, the user would expect to see a web page loaded in the simulator using WebKit. The WebKit running on the simulator does not support OpenGL 2.0 at this time. All Cascades UIs that invoke WebView will continue without errors, however, the web page will not be displayed.

 

https://bdsc.webapps.blackberry.com/devzone/resources/releasenotes

 

Fredrik

Developer
Posts: 1,006
Registered: ‎05-22-2009
My Device: Not Specified

Re: Cascades WebView Control

Thanks for Info Fredrick

New Contributor
Posts: 2
Registered: ‎05-09-2012
My Device: Blackberry 9300
My Carrier: orange

Re: Cascades WebView Control

Thanks Fredrik.

Developer
Posts: 588
Registered: ‎10-17-2010
My Device: (BlackBerry Z10)-> Q10/Passport Dual Use

Re: Cascades WebView Control

How do you load a local .html page into the WebView using QML?

Contributor
Posts: 17
Registered: ‎07-23-2010
My Device: Blackberry Storm 9530
My Carrier: Verizon

Re: Cascades WebView Control

Did you get this working?

How do you do this?

 

Contributor
Posts: 17
Registered: ‎07-23-2010
My Device: Blackberry Storm 9530
My Carrier: Verizon

Re: Cascades WebView Control

Is this working now? Can I try your example? I have OS 10 beta with cascade. Send me an example and I'll try it Tue.
New Contributor
Posts: 8
Registered: ‎03-06-2012
My Device: Playbook, 9900
My Carrier: Telenor

Re: Cascades WebView Control

The webview for cascades does not yet work. It should be working in the next beta release of cascades. Untill then, the control will only show a blank page. (Its stated on the release notes of beta 1).

 

For the playbook. The webview does not work at all.