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
New Developer
ganeshS
Posts: 133
Registered: ‎12-31-2009
My Device: Not Specified
Accepted Solution

Focus problem in Tab view.

Hello Friends,

 

I searched for the Tab Screen Sample. I got it at the following link (Credit goes to original coder).

http://supportforums.blackberry.com/rim/attachments/rim/java_dev@tkb/175/3/TabControl.java

 

I made some changes in code so that the lower screen area will be displayed after clicking on respective tabs.

 

When I click on first tab it displays the screen for first tab, similarly when I click on second tab, it displays the screen for second tab like this. Buyt the problem I am facing is... When I click on first tab it displays the screen related to first tab. When I scroll down to screen area (which is another vertical field manager) and again try to go to the upper HorizontahlFieldManager, the focus goes to the last tab (even if the first tab is selected.

 

I want the focus to directly go to the selected tab.

 

 

How can I achieve this?

 

Thanks

 

Please use plain text.
New Developer
ganeshS
Posts: 133
Registered: ‎12-31-2009
My Device: Not Specified

Re: Focus problem in Tab view.

Hello Friends,

 

Please reply this thread.

 

 

Thanks

Please use plain text.
Developer
arkadyz
Posts: 2,268
Registered: ‎07-08-2009
My Device: various
My Carrier: various

Re: Focus problem in Tab view.

You'll need to remember where the focus was before it left the tab manager and return it there when the manager gains focus again. Make it implement FocusChangeListener and listen to its own focus changes. On FOCUS_GAINED, check whether the saved lastFocused field is not null; if it is not, setFocus there (wrap it in invokeLater), otherwise save the currently focused field. On FOCUS_CHANGED, simply save the currently focused field. You have nothing to do on FOCUS_LOST.

----------------------------------------------------------
please click 'Accept Solution' on posts that provide the solution to the question you've posted. Don't say "Thanks", press 'Like' button instead!
Please use plain text.
New Developer
ganeshS
Posts: 133
Registered: ‎12-31-2009
My Device: Not Specified

Re: Focus problem in Tab view.

[ Edited ]

Hello arkadyz,

 

Thank you for your reply. I tried the solution you suggested. It is not working, I think I am missing something. Please share any link if you have for the same problem.

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

Re: Focus problem in Tab view.

The instructions given look correct to me.  Can you describe what happens in your code?  Perhaps a snippet, especially of your FocusChangeListener.  In fact probably best to create a sample screen using all standard components.  It wouldn't be too much code.  Paste that in here and we can look at your code and help you correct it. 

Please use plain text.