I am Trying to use TextField in javafx. The scenario is I have list view populated with specific objects and edit button to edit the object associated with list cell of list view. When I click on edit button it redirects me to a pane with editing feature when I can edit the name of that object and save it using save button. So I have to put validation on save button to make it enable and disable . If I edit the name in text field then it should enable the save button other wise it should remains disabled. I have tried using different methods on text fields as below.
textField.textPorperty.addListener(listener -> {
//Logic to enable disable save button
});
As I am using list view, this listener gives me old value as previously edited object which does not satisfy my condition. I can not use
`textField.focusedProperty().addListener((observableValue, oldValue, newValue) -> {});`
as It does not give me expected behavior.
Can anyone help me to solve this issue?
textField.textPorperty.addListener(listener -> {
//Logic to enable disable save button
});
As I am using list view, this listener gives me old value as previously edited object which does not satisfy my condition. I can not use
`textField.focusedProperty().addListener((observableValue, oldValue, newValue) -> {});`
as It does not give me expected behavior.
Can anyone help me to solve this issue?