I did not understand the comment on the ticket that was opened
Re: [INFO REQ] TextField with error
Posted: Mon Sep 12, 2022 3:07 pm
by mats
It works as designed, we don't auto apply to the model if the field is invalid. Try removing:
myField.setError('My error');
And it works.
Re: [INFO REQ] TextField with error
Posted: Mon Sep 12, 2022 3:31 pm
by henrique
Yes, if removing it works. But the problem I have, is for example, the user puts invalid characters in the field, when he tries to save the information, I mark the field with error and put the message. Of course, the user will remove these invalid characters and try to save the information, but because the record is not updated, the validation error remains. Because validation is done in the record, not in the field that is on the screen.
One path I found to resolve is to put in the field change event, to remove the error, but the problem I have multiple fields with would have to replicate this change in various locations of my system, which makes this implementation inviable.
Re: [INFO REQ] TextField with error
Posted: Thu Sep 15, 2022 3:14 pm
by alex.l
Hi henrique,
Try to update record and validate in same place, as example by Save click.
I thought it would be another function. For only one field is easy, but the problem is that I have multiple fields in multiple windows, and replicating this implementation by the entire system is unusable.
Re: [INFO REQ] TextField with error
Posted: Fri Sep 16, 2022 2:28 pm
by alex.l
https://bryntum.com/docs/grid/api/Core/data/Model#function-set allows to set all together, not only one field.
Field validation created to prevent set invalid data to the record. That's expected behaviour.
I think you just need to try to change your approach for validation or adopt your solution.