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
Developer
bbquincar
Posts: 304
Registered: ‎08-14-2012
My Device: PlayBook, Z10, Dev C
Accepted Solution

WebView Functions

Is there any documentation on Webview fuctions allowing control back, foward refresh. if someone could point me in the right direction that would be great thanks in advance.

BlackBerry 10 game reviews for the unknown, small and indie developers. Little games with big dreams. VeryBerryGames.com | Follow @VeryBerryGames | TwoCasualCoders.com | never casual on quality
Please use plain text.
Developer
bcs925
Posts: 262
Registered: ‎07-13-2012
My Device: PlayBook, DA B, DA C, LE Z10 #102, Q10, Z30

Re: WebView Functions

Quick example I threw together... its pretty self explanatory.  I will do a full write up on my blog soon:

 

import bb.cascades 1.0

Page {
    content: Container {
        background: Color.create(0.25, 0.25, 0.25)
        TextArea {
            text: "Text up here"
            editable: false
            textStyle {
                //   size: 30
                fontWeight: FontWeight.Bold
                color: Color.White
            }
        }
        Container {
            layout: StackLayout {
                orientation: LayoutOrientation.LeftToRight
            }
            Button {
                id: button1
                text: "Back"
                onClicked: {
                    myWebView.goBack();
                }
            }
            Button {
                id: button2
                text: "Forward"
                onClicked: {
                    myWebView.goForward();
                }
            }
            Button {
                id: button3
                text: "Refresh"
                onClicked: {
                    myWebView.reload();
                }
            }
        }
        Container {
            ScrollView {
                scrollViewProperties.pinchToZoomEnabled: true
                scrollViewProperties.scrollMode: ScrollMode.Both
                WebView {
                    id: myWebView
                    url: "https://www.google.com/"
                }
            }
        }
    }
}

 

 

Reference from documentation (https://developer.blackberry.com/cascades/reference/bb__cascades__webview.html):

 

void goBack ()

Navigates to the previous page in the navigation history.

If there's no previous page, this method does nothing.

void goForward ()

Navigates to the next page in the navigation history.

If there's no next page, this method does nothing.

void stop ()

Stops any loading in progress.

If no loading is in progress, this method does nothing.

void reload ()

Reloads the current page.

---
Check out my BB10 Cascades Coding site: BBcascades.com & Cascades Blog: bbcascadescode.tumblr.com

My Built for BlackBerry app: The Dive Plan
Please use plain text.
Developer
bbquincar
Posts: 304
Registered: ‎08-14-2012
My Device: PlayBook, Z10, Dev C

Re: WebView Functions

Oh my god your my hero lol thanks great example

BlackBerry 10 game reviews for the unknown, small and indie developers. Little games with big dreams. VeryBerryGames.com | Follow @VeryBerryGames | TwoCasualCoders.com | never casual on quality
Please use plain text.
Developer
bbquincar
Posts: 304
Registered: ‎08-14-2012
My Device: PlayBook, Z10, Dev C

Re: WebView Functions

[ Edited ]

I was looking for these other WebView functions are the avaible yet 

  • add to homescreen
  • reader
  • Share page
  • find on page
  • Site Info

Thanks

BlackBerry 10 game reviews for the unknown, small and indie developers. Little games with big dreams. VeryBerryGames.com | Follow @VeryBerryGames | TwoCasualCoders.com | never casual on quality
Please use plain text.
Developer
bcs925
Posts: 262
Registered: ‎07-13-2012
My Device: PlayBook, DA B, DA C, LE Z10 #102, Q10, Z30

Re: WebView Functions

I know you can use reader (my friend has it in one of his apps already) so I wouldn't see why not for the others.
---
Check out my BB10 Cascades Coding site: BBcascades.com & Cascades Blog: bbcascadescode.tumblr.com

My Built for BlackBerry app: The Dive Plan
Please use plain text.
Developer
bbquincar
Posts: 304
Registered: ‎08-14-2012
My Device: PlayBook, Z10, Dev C

Re: WebView Functions

ok besides the normal dev cascades site is there other doc i can find them.

BlackBerry 10 game reviews for the unknown, small and indie developers. Little games with big dreams. VeryBerryGames.com | Follow @VeryBerryGames | TwoCasualCoders.com | never casual on quality
Please use plain text.
Developer
bcs925
Posts: 262
Registered: ‎07-13-2012
My Device: PlayBook, DA B, DA C, LE Z10 #102, Q10, Z30

Re: WebView Functions

I haven't seen any other docs on this subject. Why are you looking for an example? If so I'll be sure to make one soon.
---
Check out my BB10 Cascades Coding site: BBcascades.com & Cascades Blog: bbcascadescode.tumblr.com

My Built for BlackBerry app: The Dive Plan
Please use plain text.
Developer
bbquincar
Posts: 304
Registered: ‎08-14-2012
My Device: PlayBook, Z10, Dev C

Re: WebView Functions

Yes I'd very interest in seeing all the browser funtions. My app is fully based around it thanks.
BlackBerry 10 game reviews for the unknown, small and indie developers. Little games with big dreams. VeryBerryGames.com | Follow @VeryBerryGames | TwoCasualCoders.com | never casual on quality
Please use plain text.