dimanche 11 décembre 2016

Javafx update tableview on Checkbox change

I have an huge amount of data which i display with TableView in JavaFX. With help of JavaFX 8 Sortung Filtering i was able to implement the filter depending on the input (TextField). There are only a few different states which a entry is able to have, so i want to make a quickselect with Checkboxes.
For example: The user want to see all rows with state "In Progress" or "Completed". So he checks the two checkboxes with the specific states.

How do I have to implement the specific Listener, that the TableView is going to show only the filtered data?

My code so far:

ChangeListener<Boolean> cbStateChangeListener = new ChangeListener<Boolean>() {  
    @Override
        public void changed(ObservableValue<? extends Boolean> ov, Boolean old_val, Boolean new_val) {
            if (new_val){

            }
        }
    };

How to proceed in the if-statement?




Aucun commentaire:

Enregistrer un commentaire