AlphanumericNavTable: NullPointerException when showing warning

Published on: 12/05/2011

When you create a form without using the layer based constructor, internal attribute layer remains null, which results in a NullPointerException in this line inside the showWarning method when changed is true (you have unsaved changes): boolean save = changed && layer.isEditing(); I'm not sure how it should work when you don't have a layer but a recordset (I checked out its methods but I didn't find one which fitted for this purpose).

Operating SystemLinux




Thu, 12/05/2011 - 16:24

have you checked the alphanumericform? is that ok for you?

Thu, 12/05/2011 - 16:58

Sorry, my description was a bit weak, I should have told you that the problem is not exactly with a form, but with AbstractNavTable's code (the lines I pasted come from it), and what I'm using is a AlphanumericNavTable created with an IEditableSource got from a dbf .

Wed, 18/05/2011 - 18:04

In alphanumeric we should use de IEditableSource.isEditing() method. A possible solution is overwrite showWarning in AlphanumericNavtable (see attached patch). It's not a nice solution but it works and don't need a big refactoring.

Mon, 01/08/2011 - 09:13

Hey guys, what about this patch? Could you review it works and commit it?

Sat, 01/10/2011 - 11:50

Applied patch in revision 435