Firstly, I am working on Windows 7, Netbeans 8, JDK 8.
I have a TableView
containing POJO
objects (not using properties).
I am trying to implement "search while typing" but something strange happens.
In this image you can see that ALL the students are being displayed:
In the next picture after the search is done you can see the problem.
First 4 students are the actual search results and are clickable active entries in the TableView
.
All the others entries are visible but not responding, but instead they should have been removed completely.
How it works (coding part):
1. When users types 'f' a function is called.
2. In the function I create new list that will contain the search results:
ObservableList<Student> subentries = FXCollections.observableArrayList();
3. Then I add all items matching the criteria of the search in subentries
list
4. I call:
5. studentsTable.setItems(subentries);
Erroneous result is shown in picture 2.
HACKS I tried:
1. randomButton.fire();
2.
columnsOfTheTable.get(0).setVisible(false);
columnsOfTheTable.get(0).setVisible(true);
The above don't work.
Any help would be appreciated.
Thanks