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

Reply
New Developer
Posts: 11
Registered: ‎02-17-2009
My Device: Not Specified

Browser Scroll

Is there a way to tell a browser to scroll programmatically.  Like if I override a key event, could I tell the browser to scroll a certain amount?  I'm thnking like a BrowserContent object.

 

Thanks

-Steve

Guru I
Posts: 19,007
Registered: ‎07-29-2008
My Device: Passport, Playbook, 9320BES
My Carrier: Bouygues _ SFR

Re: Browser Scroll

you can use href with # and move to it with javascript.



The search box on top-right of this page is your true friend, and the public Knowledge Base too:
New Developer
Posts: 11
Registered: ‎02-17-2009
My Device: Not Specified

Re: Browser Scroll

Thanks.  I should have been more specific.  I mean with Java code, can I instruct the browser field to scroll?  I don't want web page to be required to include anything extra.  Very minimal bandwidth usage for presentation data only.
BlackBerry Development Advisor
Posts: 15,144
Registered: ‎07-09-2008
My Device: BlackBerry Passport
My Carrier: Bell

Re: Browser Scroll

Scrolling is handled by the browser field itself.  It does not expose any methods to programmatically scroll its position.  However, you could use the EventInjector class to inject trackball movement into the field, simulating the user scrolling themselves.

Mark Sohm
BlackBerry Development Advisor

Please refrain from posting new questions in solved threads.
Problem solved? Click the Accept As Solution button.
Found a bug? Report it using Issue Tracker
New Developer
Posts: 11
Registered: ‎02-17-2009
My Device: Not Specified

Re: Browser Scroll

Thanks for the idea.  I remember doing that in a few cases with early windows 3.1 programming.  I'm looking for a clean solution that doesn't involve too many "tricks". The reason being I am looking for a lot more control than just scroll, and I don't want to have to find workarounds for everything, it will take too much time, and there is no guarantee I'll be able to work around even half of my requirements.  I was hoping this post would expose something obvious that I'd missed.

 

Again, thanks for the input

-Steve

Developer
Posts: 21
Registered: ‎01-08-2009
My Device: Not Specified

Re: Browser Scroll

If you have a solution to this, I'd really like to hear about it. I'm facing the same issue. Injecting events really only approximates the position you would like the browser to be. Navigation events scroll the browser by different offsets each time, so you can never put it exactly where you want it. This is really frustrating. Adding and removing browser fields and remembering their scroll offsets is really crucial functionality for anything involving showing more than a single page...
Developer
Posts: 21
Registered: ‎01-08-2009
My Device: Not Specified

Re: Browser Scroll

Our technical contact at RIM confirmed that there is no way to do that.

 

There is a hack for OS 4.6+ where you first adjust the scroll, and then you set focus by coordinates to somewhere inside the browser control. This doesn't work on 4.5 though.

 


sday wrote:

Is there a way to tell a browser to scroll programmatically.  Like if I override a key event, could I tell the browser to scroll a certain amount?  I'm thnking like a BrowserContent object.

 

Thanks

-Steve