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

Web and WebWorks Development


Thank you for visiting the BlackBerry Support Community Forums.

BlackBerry will be closing the BlackBerry Support Community Forums Device Forums on April 1st (Developers, see below)

BlackBerry remains committed to providing excellent customer support to our customers. We are delighted to direct you to the CrackBerry Forums, a well-established and thorough support channel, for continued BlackBerry support. Please visit http://forums.crackberry.com or http://crackberry.com/ask. You can also continue to visit BlackBerry Support or the BlackBerry Knowledge Base for official support options available for your BlackBerry Smartphone.

"When we launched CrackBerry.com 10 years ago, we set out to make it a fun and useful destination where BlackBerry Smartphone owners could share their excitement and learn to unleash the full potential of their BlackBerry. A decade later, the CrackBerry community is as active and passionate as ever and I know our knowledgeable members and volunteers will be excited to welcome and assist more BlackBerry owners with their questions."

- Kevin Michaluk, Founder, CrackBerry.com

Developers, for more information about the BlackBerry Developer Community please review Join the Conversation on the BlackBerry Developer Community Forums found on Inside BlackBerry.


Reply
Contributor
Posts: 18
Registered: ‎03-08-2011
My Device: Not Specified

Stopping scrolling / page dragging on playbook

Hi,

 

I have a playbook app developed using the webworks toolkit. My app has a couple of Divs, each one being the size of the playbook screen (1024x600). They're all part of the same html document.

 

I only display one Div at a time (the others are hidden during that time). When the user clicks a menu item, I switch to a different Div (almost like a tab bar).

 

My problem is that on the simulator (and I'm guessing on the real hardware as well), you can drag the viewable page (which is only displaying the one Div) around (up, down, left right) and it shows a gray area around the edges where the page is being dragged.

 

How do I "lock" my page and disable dragging?

 

I tried the following:

 

document.ontouchstart = function(event) {
   event.preventDefault();
}

document.ontouchmove = function(event) {
   event.preventDefault();
}

document.ontouchend = function(event) {
   event.preventDefault();
}

 

However, when I add the above, then I can't click on buttons that I have on my Divs... it won't register the default event.

 

I've been struggling with this problem for a while now.

 

Thanks!

Retired
Posts: 3,708
Registered: ‎10-16-2008
My Device: Z10
My Carrier: Rogers

Re: Stopping scrolling / page dragging on playbook

I believe it is done using the viewport meta tag.. I "think" the meta tag given in the following post will stop the drag "boing" Smiley Happy

 

http://supportforums.blackberry.com/t5/Web-and-WebWorks-Development/Forcing-PlayBook-not-to-zoom-on-...

Tim Neil
Director, Application Platform & Tools Product Management
Follow me on Twitter
Contributor
Posts: 18
Registered: ‎03-08-2011
My Device: Not Specified

Re: Stopping scrolling / page dragging on playbook

Hi Tim,

Thanks for the response... unfortunately on luck with that. The drag "boing" (nice name for it Smiley Very Happy) still happens.

Any other ideas?

Thanks!
Retired
Posts: 3,708
Registered: ‎10-16-2008
My Device: Z10
My Carrier: Rogers

Re: Stopping scrolling / page dragging on playbook

From talking to the browser team, they suggest making your content fit the screen like you mentioned in the first post.  You'll have to make sure your margins are adjusted as well down to zero.  Basically if there is any content to scroll at all you will get the "boing".

 

You may also need to ajust the width/height that would account for any kind of margin inside a WebWorks app.

Tim Neil
Director, Application Platform & Tools Product Management
Follow me on Twitter
Contributor
Posts: 18
Registered: ‎03-08-2011
My Device: Not Specified

Re: Stopping scrolling / page dragging on playbook

Tim,

Thanks for the quick response. I tried this and this seems to work... however, the one snag I've hit is when I bring up the virtual keyboard (to input text into textfields), this pushes up the page and when the keyboard is hidden, the page then remains partially hidden on top, with a white gap at the bottom.

Any suggestions on how to deal with that?

Thanks!
Contributor
Posts: 30
Registered: ‎02-04-2011
My Device: BB9900 & PlayBook16GB
My Carrier: Rogers

Re: Stopping scrolling / page dragging on playbook

[ Edited ]

I am also interested in this, there should be a way to disable page scrolling from within config.xml or a meta tag.

Also, make sure that overflow on body element is hidden. I am using jquery mobile and found that I had to use:

 

<div data-role="page" style="overflow:hidden;">

<div data-role="content" style="overflow:hidden;">

 

</div>

</div>

 

It still scrolls when the keyboard pops up, which I would love to disable.