Using TableControl without TableController

Issue #34 resolved
Javlon Eraliyev created an issue

I use TC as data container without setting TController (it is ok if I set). But when I trigger (click on table cell) focus it throws NullPointerException in TC.java line 735:

if (!mode.get().equals(Mode.INSERT) || newValue.getRow() == -1 || oldValue.getRow() == -1) { //line 735
    return;
}

From a programming standpoint it is recommended to write this:

mode.get().equals(Mode.INSERT)

like this:

Mode.INSERT.equals(mode.get())

or

(mode!=null && mode.get().equals(Mode.INSERT)) 

because mode.get() can throw null pointer exception.

Anyway how can I use TC without TController?

Comments (4)

  1. Javlon Eraliyev reporter

    I defined that, focusing table with Controller but without calling reload() throws NPE.

  2. Amrullah

    I wonder why you avoid TableController.

    Btw, you should be able to modify the list of records:

    List<R> lstRecord = tableController.getRecords();
    lstRecord.clear();//clear tableControl
    lstRecord.add(new Record());//add one row
    

    something like that.

  3. Log in to comment