Hi,
I'm trying to enable a save button on a key press event when DynamicForm.valuesHaveChanged() is true.
This the code I have so far:
With the above code, when I type a single character in the item, the save button is disabled still. However, when I type a second character, the save button is enabled. This leads me to believe the values aren't compared (or the valuesHaveChanged() method doesn't have access to the new values) until after handling the key press event.
Is there a way for the key press event to be handled after the values are compared?
Thanks in advance!
I'm trying to enable a save button on a key press event when DynamicForm.valuesHaveChanged() is true.
This the code I have so far:
Code:
form.addItemKeyPressHandler(new ItemKeyPressHandler() { @Override public void onItemKeyPress(ItemKeyPressEvent event) { // Disable when values have not changed saveButton.setDisabled(!form.valuesHaveChanged()); } });
Is there a way for the key press event to be handled after the values are compared?
Thanks in advance!
Comment