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: 27
Registered: ‎02-12-2010
My Device: Torch 9800
My Carrier: Globe/Unlocked AT&T
Accepted Solution

Rearranging Stack Order of Fields in a Custom Manager

[ Edited ]

I'm creating a custom manager where the contained fields overlap with each other (just like folder tabs) and I want the field to be displayed on top of other tabs when selected.

 

What I did were (but all failed)

  • added an array of Fields to the custom manager in their order, but during sublayout, I set the field's position and layout it first before any other fields
  • added the selected index to the manager first, but the order of focus also changes.

 

Does anyone know how to rearrange their display stack order? Is it even possible?

Thanks!
Highlighted
Developer
Posts: 19,631
Registered: ‎07-14-2008
My Device: Not Specified

Re: Rearranging Stack Order of Fields in a Custom Manager

This is only my understanding....  Not fact.

 

My understanding is that a Manager will display or paint the Fields in the order that they are added.  Focus will also be default move in this way.  When focus moves, the Field is repainted with focus, but what this really means is that the area of the Screen is repainted.  The Manager will know the Fields that are displayed in the area that needs to repainted and will ask them to repaint themselves. 

 

So if you have two Fields and they overlap, the second Field will always paint over the first Field, which is not what you want if the first Field is in focus.   

 

In short, using my 'model', if you want something on top, it has to be the last thing added to the Manager. 

 

So when focus moves, you also have to add and remove Fields to the manager.  This is not an operation that I would actually recommend.  Changing Field in Managers in this way is 'expensive' in terms of the processing and might slow the whole thing down, if in fact it works - I am not sure how well a Manager would cope with having the Field in focus removed and re added.  But it is probably the easier option, at least the easiest I can think of.  The only other option I can think of involves some fancy paint processing. 

 

Do you want to give this a go and see how you get on?