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 Developer
Mollejuo
Posts: 6
Registered: ‎05-02-2013
My Carrier: None

Second page scroll -> webview with Google Maps

Hello,

 

I have a very simple app with the following code in main.qml:

 

import bb.cascades 1.0

Page {
    ScrollView {
        touchPropagationMode: TouchPropagationMode.PassThrough

        WebView {
            url: "http://maps.google.com/"

           preferredHeight: 1200
            
        }

    }
}

 

It works, when the user taps on a POI (a restaurant for example) it opens a new page with information of it. Great! However, that new page can't be scrolled in any direction. Needles to say I need for that second/new page to be scrollable.

 

Any suggestions?

 

Many Thanks!

Please use plain text.
New Developer
Mollejuo
Posts: 6
Registered: ‎05-02-2013
My Carrier: None

Re: Second page scroll -> webview with Google Maps

No one? No suggestions? :-P

 

I installed the new versions of the SDK and simulators, hoping the latest ones will address the issue, but nothing, same behaviour.

 

For the record, it's possible to make the second page scroll, however, if this is done, the first one doesn't. Given that the first screen is a Mapview, well, lets say that this metho its not that usefull.

 

Agian, any suggestion, will be welcomed.

 

Thanks!

Please use plain text.
BlackBerry Development Advisor (Retired)
whoang
Posts: 71
Registered: ‎11-08-2012
My Carrier: BELL Canada

Re: Second page scroll -> webview with Google Maps

Hello @Mollejuo,

 

Have you considered using MapView{ } within a Container{ } for display?  The MapView supports moving to specific coordinates, zooming, and panning.  

 

You may dig deeper from the respective "main.qml" file from the sample apps below:

Web MapView 

MapView 

 

Thanks,

William Hoang

Application Developer Advocate | Developer Relations
BlackBerry


Please use plain text.
New Member
Fernando_Vazquez
Posts: 1
Registered: ‎05-22-2013
My Carrier: Movistar

Re: Second page scroll -> webview with Google Maps

You could try something like this:

 

    ScrollView {

        id: scrollView

        touchPropagationMode: TouchPropagationMode.PassThrough

        Container {

            WebView {

                id: webView

                url: <base URL>

                onUrlChanged: {

                    if (webView.url != <base URL>) {

                        scrollView.touchPropagationMode = TouchPropagationMode.Full

                    }

                }

                onMinContentScaleChanged: {

                    scrollView.scrollViewProperties.minContentScale = minContentScale;

                }

                onMaxContentScaleChanged: {

                    scrollView.scrollViewProperties.maxContentScale = maxContentScale;

                }

            }

        }

    }

 

In case that the <base URL>  was functioning correctly, and there is a back option you'll have to add the coresponding else if sentance setting scrollView.touchPropagationMode: TouchPropagationMode.PassThrough

 

 

Please use plain text.
New Developer
Mollejuo
Posts: 6
Registered: ‎05-02-2013
My Carrier: None

Re: Second page scroll -> webview with Google Maps

Hello William,

 

Thanks for the suggestions.

 

I considered them, however in my case is a Webapp, so using any of the suggested routes will not work in my case. Beside, neither of the two example can be compiled, for Web MapView the QDE won't built the binaries, regardles of how many times I execute Build. For MapView, the device binary is built, however the simulator one its not, so I can't see it running.

 

Oh well ...

 

Thanks again.

Please use plain text.
New Developer
Mollejuo
Posts: 6
Registered: ‎05-02-2013
My Carrier: None

Re: Second page scroll -> webview with Google Maps

Fernando,

 

Your suggestion makes complete sense. However when I did it, behaviour reamined the same.

 

:smileyindifferent:

 

Thanks for the suggestion anyway.

 

Cheers!

 

Please use plain text.
New Developer
Mollejuo
Posts: 6
Registered: ‎05-02-2013
My Carrier: None

Re: Second page scroll -> webview with Google Maps

Guess I'll have to resort to forgo putting this webapp on the Blackberry App World and send people to open the browser and "Add to Home Screen". After all, within the phone's browser it works perfectly!

 

Thanks to all for your suggestions.

 

Cheers!

 

Please use plain text.