03-26-2009 12:40 PM
I have a very simple app that is a MainScreen, with a HorizontalFieldManager, with some custom Fields added to it. The app runs find and renders when I use the default style in the custom fields. However, when I set FOCUSABLE style on the custom fields, the app throws a NullPointerException (I think on a null defaultFocus item) in the onDisplay method of my MainScreen (called as a direct result of UiApplication.pushScreen()).
I'm developing on JDE 4.2.1, Simulator 8800. Anyone have any ideas to help diagnose and fix?
Solved! Go to Solution.
03-26-2009 01:14 PM
Not after the initial call to UiApplication.pushScreen() ...
Screen.onDisplay() <-- boom Screen.callOnDisplay() UiEngineImpl.pushScreen( Screen ) UiApplication.pushScreen( Screen ) DBApp.DBApp() DBApp.main( String )
03-26-2009 01:21 PM
03-26-2009 04:41 PM
I had read the Field docs, and gave your suggestion a try. What I found was that isFocusable() on my custom fields was getting called. But onFocus wasn't. I had an onFocus() in the manager that contained the fields, though. I took a look at that and noticed it only had a log message in it. For some reason, I had neglected to make the call to super.onFocus(). And that was the problem. When I added that back in (and actually, removed the override at the manager level all-together), the exception went away and all things began working again.
Thanks for the help.
05-09-2010 11:11 AM
I have the similar symptom:
NullPointerException within onDisplay().
This error is quite annoy because we have to clue to find out the error.
In my case, the cause of this exception is different. I post here and hope that it is helpful for other people:
- I have a Manager object without any "focusable" field in side.
- I override Manager.isSelectable()
- Add a NullField to the Manager.