Reactive Web - Validation Error does not go away until I type in field again

I've seen a fair number of people having troubles with validations in Reactive but none were quite the same as this one I'm experiencing.

We have a field, lets call it ProductID. It has a certain pattern (letters and numbers) to it which we validate against. 

You can search with this field and get results directly or leave it blank and use other fields to find similar matches. 

If you insert an invalid pattern, the field's valid gets set to false and the 'Invalid Product ID' message is set. 

If now you decide to delete the text inside this field, and hit search, you will get some other validations on other fields but this one should be set to valid, since it's blank. I follow the whole process in the debugger and I can guarantee 100% the Input widget is set to Valid, and the validation message is unset.


The state of the field at the end of validations. Some names obscured for Client's privacy.


The error remains on screen: 

It won't go away, it should auto refresh yeah?

If you click into the field, error remains. As soon as you type one letter, it disapperas and the field becomes valid as normal. I think Outsystems is skipping the redraw of this one particular field for some reason and I can't find out why.


Anyone has any similar experience or way to troubleshoot this?


Cheers


no, i mean as a property of a button, you can choose for built-in validations to be run.  

Apparently, when that is set to no on a button, the code does not repaint validation related stuff.


See attached oml, test on Employee detail screen by first typing 666 in the fields and saving, making the custom validation go off.  Then compare both clear buttons.


Not sure that explains what is wrong in your case, though, but a similar problem of the software being a little bit too lazy about repainting...

Dorine

QDRInputValidation.oml

Hi,

Add an onchange action on your input field and when you clear the invalid data from the field set its valid property to true as it not required for save action for this you use if condition

if(input.typedValue="",valid=true, valid=false),

this will set the valid property true and won't give you error on click of save action, 

Hope this help,

Regards,

Komal

Thanks for your response.

At the end of validations the fields' validity is set to true, I don't believe that's the issue. 

You mean adding javascript to access the input's typed value? 


Edit: 

Adding an onchange and checking the value of the field's variable and setting the field as valid if blank, did not work

Another observed behaviour: we have a clear search which deletes all error messages, sets all the fields to valid and their validation messages to empty strings. 

All fields behave well except the aforementioned one: 


That ´ s interesting.  That would suggest there is something different on that field compared to the others.  Some property or ???

How about if you build the exact same check on exact same datamodel and input fields, but in a mock module, do you get the same behaviour ?  If so, maybe share that module on the forum.

Another thing might be the misbehaving input is inside a webblock instead of directly on the screen.  Or maybe accidentally placed outside the form ? 

Dorine

Sadly that'd be really hard to do, since it's all client specific and they would not allow to share the model. 

Fields are the same, they're inside the same form. 

The fact that the validation message and red border disappear as soon as you type in the field, makes me think it's some specific bug within Reactive, like it skips the refresh of that one container for some reason.

Yes, but that must somehow be based on a difference between that field and the others.  Are all the others mandatory, and this one not ?  Something like that.

How about removing it, and adding it back one bit at a time.

Dorine  

I've gone through the fields a thousand times by now, sadly I can't find anything at all. Not mandatory, nothing different, not even added css classses, same input widgets. Ctrl-X'd and Ctrl-V'd the thing to force a recompile, still same behaviour.

I'll keep trying silly things cos nothing else makes sense


yes, very frustrating !

I'm trying to imitate the problem in my personal environment, the only way i can get something close to it, is to set built-in validations on the 'clear' button to no.  In that case, I guess OS decides it's not necessary to redo the painting of validation text.

If that's it, I would agree it's a bug.

By setting the built in validations to 'no' you mean on the clear button, set the fields to Valid=True and their validation messages to "" or NullTextIdentifier() ? Cos, yeah that's what we're doing and it's definitely not working.


no, i mean as a property of a button, you can choose for built-in validations to be run.  

Apparently, when that is set to no on a button, the code does not repaint validation related stuff.


See attached oml, test on Employee detail screen by first typing 666 in the fields and saving, making the custom validation go off.  Then compare both clear buttons.


Not sure that explains what is wrong in your case, though, but a similar problem of the software being a little bit too lazy about repainting...

Dorine

QDRInputValidation.oml

Hello Dorine, 

Hadn't thought of that 'event' or parameter in the buttons, swapping it to Yes made the thing work normally. Cheers for checking it out and finding that good catch! 

Marked as solution


Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.