08-06-2011 03:13 AM
I searched for the Tab Screen Sample. I got it at the following link (Credit goes to original coder).
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?
Solved! Go to Solution.
08-07-2011 02:26 PM
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.
08-08-2011 02:04 AM - edited 08-08-2011 02:06 AM
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.
08-08-2011 05:29 AM
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.