When a user enters data in the Create dialogue and then selects Cancel because it failed the validation, the data remains in the form because Cancel just hides the dialogue.
If the user subsequently tries to create a new entity, the Create dialogue is pre-populated with the data from the earlier cancelled attempt.
To prevent this from happening, you have to explicitly clear the input text when you cancel the dialogue, as follows:
(1) in the Cancel commandButton, add an actionListener that will reset the input text
Yeah, this is an old issue that I never tackled. Thanks for reminding me. I have to reengage with my coding on the project as I've been very busy with other things work and life related. I will make sure to apply your suggestion to my current dev copy and it will be part of the next release. I promise.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
When a user enters data in the Create dialogue and then selects Cancel because it failed the validation, the data remains in the form because Cancel just hides the dialogue.
If the user subsequently tries to create a new entity, the Create dialogue is pre-populated with the data from the earlier cancelled attempt.
To prevent this from happening, you have to explicitly clear the input text when you cancel the dialogue, as follows:
(1) in the Cancel commandButton, add an actionListener that will reset the input text
(2) add a method in the backing bean to reset the target
*Edit: this is an updated solution, using Primefaces ResetInput insted.
Last edit: GeraldScott 2015-10-25
Yeah, this is an old issue that I never tackled. Thanks for reminding me. I have to reengage with my coding on the project as I've been very busy with other things work and life related. I will make sure to apply your suggestion to my current dev copy and it will be part of the next release. I promise.
Hi Gerald. I'm checking out your solution right now.