on 2021 Jun 30 11:43 AM
Hi all,
I'm having troubles resetting the valueState of input fields contained in a table cell. I'm clearing the model so the data is reset but the valueState is set on the view so it persists.
I've tried getting the input field byId and setting the value state as "None" but that doesn't affect the cells of the table.
Does anyone have an idea of how this can be achieved?
I already asked this question here on stackoverflow and there I got asked if I'm setting the value state over a model. I'm not doing that but that sounds like a good idea but I haven't found any examples or documentation.
Thanks,
Birgir
Request clarification before answering.
As explained in this answer, you're probably accessing the template control instead of the real rendered ones. Only the copied controls from the template are rendered with their own IDs. Since their IDs are generated by the framework, accessing such copies with "byId" should be avoided.
Input validation and message creation is a whole different topic.* Here is one small example using a V2 OData model and letting UI5 handle message creation client-side. As you can see, if the input value exceeds the constraints, the value state of the input field is changed automatically.
___
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
57 | |
10 | |
8 | |
8 | |
6 | |
6 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.