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
plevintampabay
Posts: 141
Registered: ‎02-27-2009
My Device: Not Specified

Re: problem with tab pane appearance

[ Edited ]

Mark, We're not done here. This fix introduced another problem. When the number of tabs exceeds the number to be displayed on the screen, the new tab needs to be scrolled into view. But with this fix, only the left edge of the new tab is scrolled onto the screen. Before, the entire text of the tab's label was scrolled onto the screen.

 

I'm working on it now, to find a solution.

Developer
plevintampabay
Posts: 141
Registered: ‎02-27-2009
My Device: Not Specified

Re: problem with tab pane appearance

Ok, I finally got it.

Instead of using a NullField, I implemented a class that extends Field.

In this new class, I implemented getPreferredWidth(), layout() and paint().  Its constructor takes the width of the tab text, which is returned by getPreferredWidth and used by layout to set the extent.  Paint() draws nothing.

 

Instead of using a HorizontalFieldManager, I'm using a VerticalFieldManager, with the label of my text and this new field (called MyKludgeFld).  The label is not Focusable, but MyKludgeFld is Focusable.

 

So now when the focus moves to a tab that is off screen, it scrolls the width of MyKludgeFld and brings the entire label onto the screen.

 

Thanks for your help Mark.

 

Regular Contributor
shafich
Posts: 74
Registered: ‎01-12-2012
My Device: Developer

Re: problem with tab pane appearance

Please I have an issue with this, I used the same code as your and it works fine on the Simulator of 9900 7.1
but on the real device I would only the Tabs however I can not see the content of the "Active Tab" unless I Scroll down to it ( meaning unless the vfm gains focus ).
If the vfm does not have the focus I only see a WHITE background and not the content that should appear.

Thanks in advance for the help..
I am using BlackberryJDE 7.1 
And the testing is on Simulator 7.1 and on Real device ...
Simulator works fine .. however Real divice shows the previous issue !
 

Regular Contributor
shafich
Posts: 74
Registered: ‎01-12-2012
My Device: Developer

Re: problem with tab pane appearance

sorry I had amistake in the previous post ! 

it doesn't even work on 7.1 simulator ..same issue !
it works on simulator of 7.0 . 

Developer
plevintampabay
Posts: 141
Registered: ‎02-27-2009
My Device: Not Specified

Re: problem with tab pane appearance

What if you programmatically gave focus to a field in your vfm?