Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Creating a new user will not clear the form #891

Open
mvysny opened this issue Aug 1, 2019 · 2 comments
Open

Creating a new user will not clear the form #891

mvysny opened this issue Aug 1, 2019 · 2 comments

Comments

@mvysny
Copy link
Member

mvysny commented Aug 1, 2019

This has been reported by a customer via Expert Chat. Bakery for Vaadin 14. Please follow these steps:

  1. open the user view
  2. click on edit icon from the grid, to edit an existing user
  3. (the form is opened)
  4. press ESC key without making any change
  5. press new button

the form is opened but the fields are not empty: they are filled with the values from the previous record

@mvysny
Copy link
Member Author

mvysny commented Aug 1, 2019

Attaching the Bakery starter as downloaded from vaadin.com:
bakery-v14.zip

@mvysny
Copy link
Member Author

mvysny commented Aug 29, 2019

The problem most probably lies in vaadin-crud.

When the editor dialog is closed via the 'Cancel' button, the CancelEvent is fired properly, which runs the code at Crud.java:188 which ultimately clears the editor.

However, when Esc is pressed, the CancelEvent is not fired and the editor is not cleared. Later, when the 'Create/New' button is pressed, the event handler at Crud.java:171 reads the current editor item via e.getItem(), finds that it is not null and edits the bean instead (this is actually weird since New should always create a new empty bean instance...).

I'll file this as a bug for vaadin-crud.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant