validation messages not shown

validation messages not shown

  
Hi, 

For some reason my validation messages are not shown. I have assigned the Valid and ValidationMessages, and when I debug the values for Valid = False, but the messages are not shown. Am I missing something?

OML attached: choose the E-mail contacttype (validations are on Email and EmailTekst).

Regards, Harry

Hi Harry,

If your button is an ajax submit you'll need to refresh the widget that will show the messages, i.e. the EditRecord widget.

PS: I didn't open the eSpace but this is a common issue...

Cheers
Hi André,

Refreshing the widget did the trick! Thanks.

Regards, Harry
Andre,

I have an optional integer field with server side validation. I am using Ajax Submit refreshing the edit record widget. However, the validation to ensure the correct data type entered is not taking place at all when I enter an alpha character for example. When I check the Edit Record Valid Runtime property it remains True and when I check the Input Widget runtime property for the field to see the value of the Valid Runtime property it remains True also.

If I were to use the normal Submit method and forego Ajax Submit then the data type validation takes place but the error message is "Please enter a number" with a yellow exclamation. That is not the default message in the espace and I never created that message. So, I still think something is not correct. 

The server side validation is not doing what I think it should be doing for the optional integer field. I thought the validation for data type still takes place automatically even for optional input fields regardless if I use Submit or Ajax Submit.

Sam

André Vieira wrote:
Hi Harry,

If your button is an ajax submit you'll need to refresh the widget that will show the messages, i.e. the EditRecord widget.

PS: I didn't open the eSpace but this is a common issue...

Cheers
 
 
Andre,

It is too late for me to delete my original message. I have figured out that what is being validated depends on whether I choose Text or Number for the input type. Now, not sure which is best practice. By choosing Number originally, any input with alpha was ignored and basically a null value 0 was being evaluated. When I changed the input type to text, then anything alpha would be flagged as invalid data type. The advantage of the Number type is you get the up/down arrow control to pick an integer but the user is not prevented from entering an alpha character manually and that just gets ignored, The text type seems to have the advantage of ensuring the user enters in the correct data type without the arrow control. It doesn't seem like those arrow controls offer that much benefit. Have I correctly understood this?

André Vieira wrote:
Hi Harry,

If your button is an ajax submit you'll need to refresh the widget that will show the messages, i.e. the EditRecord widget.

PS: I didn't open the eSpace but this is a common issue...

Cheers
 
 
Hi Sam,

Yes, your issues with the validations had to do with the input type property. Your browser uses this property to choose which control to display to end-users. And depending on the browser, it might perform some validations.

For example, in Chrome if you set the type to "Number" and in the form try to submit strings, Chrome will display a yellow message telling that your input is not a valid number. Other browsers might implement different behaviors, and some don't perform any kind of validations.

This property is specially relevant when you are developing for mobile, since mobile browsers usually display a different keyboard depending on the value of the property. So if you set the property to "Number", you'll see a numeric keyboard.

Just for reference, here is the mozilla documentation for that html attribute.
Joao,

Thank you very much for the response. That was very helpful and I will look at the mozilla documentation. I do use Chrome so I guess that does explain the yellow message.

Thank you.

Sam 

Joao Fernandes wrote:
Hi Sam,

Yes, your issues with the validations had to do with the input type property. Your browser uses this property to choose which control to display to end-users. And depending on the browser, it might perform some validations.

For example, in Chrome if you set the type to "Number" and in the form try to submit strings, Chrome will display a yellow message telling that your input is not a valid number. Other browsers might implement different behaviors, and some don't perform any kind of validations.

This property is specially relevant when you are developing for mobile, since mobile browsers usually display a different keyboard depending on the value of the property. So if you set the property to "Number", you'll see a numeric keyboard.

Just for reference, here is the mozilla documentation for that html attribute.