Hello,
I am looking for a help.
I am using a Form and validation, but it looks like it changed from version 2.6 to 2.7
If I do a POST and I use
Form settingsForm = formFactory.form(SettingsForm.class).bindFromRequest(request);
the SettingsForm has one String inside (blackList) and also validates it properly
If I submit the form without an error, all is fine and I can access values the Twirl template using : @form.get().getBlackList
and
settingsForm.errors() is empty as I submitted without and error
settingsForm.rawData() have the data I submitted inside ok
but if I submit the form with error, in the template, if I access @form.get().getBlackList
I get
[CompletionException: java.lang.IllegalStateException: Error(s) binding form: {"":[“Please fix all errors.”],“blackList”:[“Invalid Emails: sd”]}]
but in
settingsForm.errors() is the error visible, so its ok ([ValidationError(blackList,[Invalid Emails: dsfs],[]), ValidationError(,[Please fix all errors.],[])])
settingsForm.rawData() have the data I submitted inside - the data which caused the validator t trigger an error ({blackList=22@22.cz, 23424@sr.cz, 2323@w.cz, 23@23.cz, 2323@aw.cz, dsfs, csrfToken=fc127ce2c4dde48953d7929bfab90a15ec2ee3d0-1591566284958-f4c4a713031e7b03c69a8bd8})
plase could anybody help?
Why i get [CompletionException: java.lang.IllegalStateException: Error(s) binding form: {"":[“Please fix all errors.”],“blackList”:[“Invalid Emails: sd”]}]
if I use @form.get().getBlackList with error inside
regards
tomas zeman