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. New to the forum? Please visit the ‘Getting Started’ link below.
inside custom component

Java Development

Reply
New Developer
vona
Posts: 22
Registered: ‎08-05-2008
Accepted Solution

How can i use both of horizontal scroll and vertical scroll?

[ Edited ]

Hi,

I am new in Blackberry. I delved into using both of horizontal scroll and vertical scroll, however there is no adequate solution (or really there is no way?). By the way, I am trying to show a datagrid on the screen, but it don't fit into the screen. There are twelve columns and over hundred rows which are neither editable nor selectable.

 

Thanks for your replies!

Message Edited by vona on 08-05-2008 09:13 AM
Message Edited by vona on 08-05-2008 09:18 AM
Please use plain text.
Developer
kzettel
Posts: 120
Registered: ‎07-16-2008

Re: How can i use both of horizontal scroll and vertical scroll?

You can create a HorizontalFieldManager for each row and add them to a VerticalFieldManager.  If they are both scrollable and the grids are focusable you should be able to scroll.  You can see a full example in the knowledge base article on How to use the UI API to create an editable table

  

Kurt Zettel | Chief Architect | Metova
www.metova.com
Please use plain text.
New Developer
vona
Posts: 22
Registered: ‎08-05-2008

Re: How can i use both of horizontal scroll and vertical scroll?

Actually, i realized that i could not mention what i mean. Yes, your reply (thank you) is the solution of scrolling on the table but i want to scroll screen on both directions. I mean, i don't want to focus, select or edit my grid's cells, just scroll the screen using scroll bars like scrolling an image.
Please use plain text.
Developer
mreed
Posts: 1,023
Registered: ‎07-16-2008

Re: How can i use both of horizontal scroll and vertical scroll?

[ Edited ]

If you override Manager.moveFocus() you can manually call setVerticalScroll() or setHorizontalScroll(). You can use status from the moveFocus function to tell whether you are moving vertically or horizontally.

 

Message Edited by mreed on 08-05-2008 10:25 AM
Please use plain text.
New Developer
JavaMEUser
Posts: 55
Registered: ‎04-07-2009

Re: How can i use both of horizontal scroll and vertical scroll?

Hi,

 

I have the same requirement but I could not get it to work. Can you please post a code snippet explaining how to override moveFocus and set the vertical scroll ?

 

thanks,

 

Please use plain text.
Developer
mnpaslay
Posts: 105
Registered: ‎03-09-2009

Re: How can i use both of horizontal scroll and vertical scroll?

I am also trying to figure this out....
Please use plain text.
New Developer
JavaMEUser
Posts: 55
Registered: ‎04-07-2009

Re: How can i use both of horizontal scroll and vertical scroll?

Please use plain text.
Developer
mnpaslay
Posts: 105
Registered: ‎03-09-2009

Re: How can i use both of horizontal scroll and vertical scroll?

[ Edited ]

I tried your link and also in debugging I checked and all my fields return true for isFocusable()...

 

To recap, I have it setup like the table demo, I have 1 main vertical manager, 1 main horizontal manager, and then 6 columns made with 6 more vertical managers.  The "cells" are RichTextFields set to USE_TEXT_WIDTH with borders...

 

I figured I would just have to set Manager.HORIZONTAL_SCROLL in the main vertical manager and then Manager.VERTICAL_SCROLL in the horizontal manager and it would work...but it will only scroll horizontally.  I have tried all possible combinations, what is interesting is that if I put the just the vertical scroll in either manager or even nothing, I can scroll vertically no problem, but not horizontally.  as soon as I put horizontal scroll in either of the main managers I can then only scroll horizontally...

 

Also, if I comment out the columns, as long as they do not overlap horizontally the vertical scroll works perfect, then, as soon as add one column that is off the screen, I can only do horizontal scroll...

Message Edited by mnpaslay on 04-21-2009 08:31 AM
Message Edited by mnpaslay on 04-21-2009 08:31 AM
Please use plain text.