04-08-2011 12:19 AM
I'm quite new to this, but I have been scouring the boards and trying many different things, and I've decided to seek advice.
There are other threads similar to my problem such as :
I have a tabbed pane set up based on the example and all works well until I delete a row from a VerticalFieldManager. It defaults the focus to the first item on the screen, and I get that. My problem is trying to override/replace that behavior.
My MainScreen implements the FocusChangeListener for the tab buttons (custom LabelFields).
I've tried many different variations - I've tried to manage the focus totally manually and ended up with a bit of a mess. I've tried catching the navigationUnclick() event and coding the focusChanged() method to manually switch the focus, but it seems that the focusChanged() method gets called before the focusChanged(), which doesn't help me.
As I said I'm fairly new to this so I could be doing something very stupid, but I don't really understand the focus handling implementation. A kick in the right direction would be appreciated.
Thanks.
Solved! Go to Solution.
04-08-2011 01:10 AM
You might want to have a NullField in your Managers before all other fields - this way, even if you delete the rest, the NullField might retain the focus.
If it doesn't help, try also overriding sublayout for your managers, call super.sublayout and then explicitly setFocus to your NullField (any field deletion causes a displayed Manager to re-layout).
04-08-2011 06:37 PM
I tried inserting a NullField and it worked like a charm. It's a nice simple solution. Thank you arkadyz.