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
Developer
rakeshsoni
Posts: 49
Registered: ‎06-02-2009
My Device: Curve8530, Curve8900, Storm9500
My Carrier: Airtel, vodaphone, Wifi
Accepted Solution

Table with Fixed header and left column

I have created a table in my application with fixed left column (left most column is fixed and remaing columns are  scrollable from left to right). is it possible to create a table with both fixed heading and fixed left column ?

 

Assume there are 10 columns and 50 rows in my tables and only 3 columns and 15 rows are visiable at a time on screen

 

(1) when user scroll from left to right only left most columns should be fixed. both table heading and remaing column scroll from left to right and vice versa. also

(2) when user scroll from top to bottems only top most heading should be fixed and remaining all rows(with left most column) should be scrollable.

 

I am able to implement any one point from above but not both. Please suggest

Please use plain text.
Developer
peter_strange
Posts: 19,599
Registered: ‎07-14-2008
My Device: Not Specified

Re: Table with Fixed header and left column

In my opinion, this is not possible using Field Managers.  I think you will have to code this yourself.   I would consider using a TableLayoutManager for the whole Table, and fake the scrolling by repopulating the displayed cells appropriately. 

Please use plain text.
Developer
rakeshsoni
Posts: 49
Registered: ‎06-02-2009
My Device: Curve8530, Curve8900, Storm9500
My Carrier: Airtel, vodaphone, Wifi

Re: Table with Fixed header and left column

Thank for quick response.

 

"fake the scrolling by repopulating the displayed cells appropriately".

If i repopulate the value in cell when user scroll,  shell I get the scrolling effect properly like it show only half cell when user scroll half of the cell.

 

Also to implement this solution I will have to override touchEvent() and add trackballListerner ?

Please explain little bit more

Please use plain text.
Developer
peter_strange
Posts: 19,599
Registered: ‎07-14-2008
My Device: Not Specified

Re: Table with Fixed header and left column

"If i repopulate the value in cell when user scroll,  shell I get the scrolling effect properly like it show only half cell when user scroll half of the cell."

 

The approach using TablelayoutManager would display single cells and the scrolling would be cell at a time.  And yes you would have to override navigationMovement and the appropriate TouchEvent methods n your TableLayoutManager so that it knew when it has to repopulate the cells. 

 

One other alternative is to have four Managers, one to do the the top left corner (the dead corner), one to do the top row (column headings), one to do the left hand column (row Headings) and one to do the rest (data).  Place all of these in a tricky row and header manager.  Only allow the user to scroll the data part.  Have the tricky manager listen for scroll events.  Then have the tricky manager add and remove the dummy, column and row header Managers as appropriate.  note that these heading Fields would not be nicely scrolled, they would either be there or they would not be displayed. That would give you your 1/2 a cell scrolling .  And you would not have to override anything to detect movement, you would left the scroll listener do that for you. 

Please use plain text.
Developer
rakeshsoni
Posts: 49
Registered: ‎06-02-2009
My Device: Curve8530, Curve8900, Storm9500
My Carrier: Airtel, vodaphone, Wifi

Re: Table with Fixed header and left column

Thanks peter for Idea. i will try and let you know
Please use plain text.