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

Java Development

Reply
Contributor
Posts: 38
Registered: ‎06-07-2010
My Device: BlackBerry Bold 9790
My Carrier: none
Accepted Solution

Scroll by step width

 

Hi,

 

I've been searching the forum for a couple of hours now but didn't find a working solution to my problem. My problem is that I've got a VerticalFieldManager that contains other Managers (e.g. HorizontalManagers with some content) and it should be possible to scroll through the VerticalFieldManager's content without having to focus every single field. In other words: I'd like to scroll within a VerticalFieldManager by a certain step width (e.g. 50 pixels) rather than by focus.

 

Isn't there any way to do that for a BlackBerry with a Trackball or Trackpad?

Contributor
Posts: 34
Registered: ‎03-14-2010
My Device: N/A
My Carrier: Fledge

Re: Scroll by step width

Its possible by overriding navigationMovement on the manager and returning true - but if scrolling doesn't put focus on the field, how would you ever put focus on the field?  

Highlighted
Developer
Posts: 2,268
Registered: ‎07-08-2009
My Device: various
My Carrier: various

Re: Scroll by step width

If you don't want to override navigationMovement() and start setting vertical scrolling position manually (i.e. Manager.setVerticalScroll()), you might consider adding focusable NullField's every 50 or so pixels.  This way your trackball/trackpad movements are still handled by BB framework according to the focus, but thanks to those NullField's they will never scroll by more than your chosen distance.

 

If you have some TextFields within and want to scroll through them rather than jumping over, consider making them focusable but not editable (READONLY).

 

This will not give you the exact behavior you want to achieve, but it will save you a lot of headache.

Still, if you are feeling brave, override navigationMovement() and use setVerticalScroll() and setFocus() as you deem necessary.  Prepare for long debugging hours (days? weeks?) trying to achieve an intuitive enough interface.  And don't complain when it doesn't work for touchscreen devices. Smiley Wink

 

Good luck!

 

----------------------------------------------------------
please click 'Accept Solution' on posts that provide the solution to the question you've posted. Don't say "Thanks", press 'Like' button instead!
Contributor
Posts: 38
Registered: ‎06-07-2010
My Device: BlackBerry Bold 9790
My Carrier: none

Re: Scroll by step width

Thank you very much for your answers. @jacobtabak: In this particular case, I don't want any of those fields to gain focus since they just view non-editable information.

 

I've already worked with NullFields to achieve this kind of behaviour but didn't know how to place them automatically on certain positions within the Manager. I'll have a look for that and try this solution again. Overriding navigationMovement() didn't work exactly the way I wanted but I'll probably give it another try.

 

Thanks for now, I'll let you know my results Smiley Wink

Contributor
Posts: 38
Registered: ‎06-07-2010
My Device: BlackBerry Bold 9790
My Carrier: none

Re: Scroll by step width

I've been very busy the last few weeks so I'm a bit late with posting my results. For me, using NullFields worked best. By using NullFields and adding them to certain positions of the screen, scrolling was possible but not very seamless.

 

Hopefully there'll be a solution to that problem in later releases of the BlackBerry API but for now this solution works, too.

 

Thanks again for your help!