Input Validation Exercise Help
Question

Hi.
I'm doing the Becoming a Traditional Web Developer Guided Path.
I did almost all the exercise. Everything was working well, until the last part:

Add Validations in the PersonDetail Screen Now that we have added and tested custom validations for movies, we will also do the same for the PersonDetail Screen. We will add validations to verify if the Birth Date is before the Current Date, and if the Person’s Date of Birth is later than the Person’s Date of Death.


I tried to do the same as the step by step instructions told me about MovieForm.

The validations are working. I cant save with a Date of Birth after Date of Death and/or after current date.

The feedback msg tell me I need to fix the errors. Ok that part.

The issue:

Should be showed 2 msgs with error below the input fields:

"Date of birth can't be after date of death"

and

"Date of birth can't be a future date"

I would like to know where is my mistakes




Solution

OKay,

Now  I am able to install your application and worked on it, Now messages are visible on the save button with a feedback message.


just added refresh ajax and  Input_FocusFirstInvalid at the right place. Please validate it.

https://amitj.outsystemscloud.com/OSMDb/PersonDetail.aspx?PersonId=5

OSMDb.oml

mvp_badge
MVP
Solution

Hello again prtpj,

In this case, you really need an Ajax Refresh, otherwise that part of the screen won't be refreshed and those messages won't appear in the screen.

Checking on your code, you are already using an Ajax Refresh in the beginning of the action:

You just need to copy that yellow marked element in your flow and use it in the True branch of the not PersonForm.Valid condition.


Kind regards,

Rui Barradas

mvp_badge
MVP

Hello there prtpj,

Hope you're doing well.

It seems to me that you're just missing an Ajax Refresh, when the form is not valid.

Can you try to add an Ajax Refresh for the PersonForm element in the True branch of the not PersonForm.Valid condition and check if it works?

Everything else seems to be correct :)


Kind regards,

Rui Barradas

Hi Rui. I didnt think about "ajax refresh" because this isnt explained yet in the guide. I cant do a thing I dont know yet 

Will be the next lesson.


I thought the optional thing on that exercise was to do the same I did previous in all other actions mentioned at the exercise's end.

mvp_badge
MVP
Solution

Hello again prtpj,

In this case, you really need an Ajax Refresh, otherwise that part of the screen won't be refreshed and those messages won't appear in the screen.

Checking on your code, you are already using an Ajax Refresh in the beginning of the action:

You just need to copy that yellow marked element in your flow and use it in the True branch of the not PersonForm.Valid condition.


Kind regards,

Rui Barradas

But how should I do a exercise with a thing I didnt learn yet?? Cant I do only with I had learned?

Hi Prtpj,


I think Rui is right, but it's difficult to say from this screenshot only. If you need more details please include your oml so we'll be able to reproduce your issue and help better :)


Thank you

Hi prtpj,

Without much information, can't able to find the exact mistake.

Here i have attached the oml. It's working fine.

Hope this helps!

Regards,

Ellakkiya.S


OSMDb.oml

Hi prtpj,

Have you solved this issue? 


Regards,

Ellakkiya.S


Hi prtpj,

I think your expectations are incorrect.  

For each input, there is only one single validation message shown.  

So if multiple things are wrong with the same field, only the last assigned value of  ThatInputWidget.ValidationMessage will be displayed.

So in your case, if you want both messages to show if both validations are in going off at the same time, you could for example use the validationMessage of DateOfBirth input for signaling a future birth date, and use validationmessage of DateOfDeath input if DoB is after death.  In that case, I think I would make both inputs invalid, and set the message with DateOfDeath.

Dorine

Hi. I believe its not the case.
There are 2 input fields Date of Birth and Date of Death. I want a validation msg on each one, but i'm getting no msg on any of them.

Simple you can use a switch statement.

1  in the first condition checks both conditions if both are false then you can show both messages using Concat both.

2. in the second condition if one condition is false then show a message according to that.

3 in last if the remaining condition is false then show message according to that.

Best of Luck

AJ

I'm uploading the oap file which was created during lessons.



OSMDbprtpj.oap

And the pdf with exercise

7.5xInputValidationExercise.pdf

Can you share only OML. Getting issue to instal .oap in personal env.

I will try that and tell you later

The file which you asked

OSMDbprtpj.oml

Just remove highlighted feedback message then both messages will work.


refer my below reactive application for the same logic...


Hi. When I did remove the feedback msg which you marked, didnt work.

Actually only gone with warning msg at top screen 

I dont want remove this warning msg.


On Movie Detail Screen I get this error msg below the input field when the movie didnt launch yet and Gross isnt = 0

I want to get the same thing on Person Detail Screen below Date of Birth and Date of Death input

I tried to do the same as the exercise told me on Movie Screen, but something I did wrong and I dont know what.

Solution

OKay,

Now  I am able to install your application and worked on it, Now messages are visible on the save button with a feedback message.


just added refresh ajax and  Input_FocusFirstInvalid at the right place. Please validate it.

https://amitj.outsystemscloud.com/OSMDb/PersonDetail.aspx?PersonId=5

OSMDb.oml

Hi Amit.

Thx for the help

Rui already told me about Ajax (and I will try that)


But as I did question him, for me is a bit odd a necessity to use a feature (Ajax) which I didnt learned anything about it yet. I'm doing the Becoming a Traditional Web Developer Guided Path and the feature Ajax is a future lesson.


EDIT:

That ajax refresh I didnt create on my own. It was created automatically during one of the exercises.

Hi prtpj,

It's a strength, but I just changed Lable position for personal form and it is working now(without Ajax refresh). 

I don't know what the issue with that.


Amit Jain

OSMDb.oml

Hi Amit.
I got your oml and did compare with mine. I did the alterations removing the entire line with the ajax from flux:

And changed what you told me about label position, but didnt work.
One detail I didnt see was the save button method.

I did delete the Ajax line, but I didnt change the button method from Ajax to Submit:

Changing that the issue was solved without Ajax and keeping original label aligh.


Thx for all the help.


mvp_badge
MVP

Can you check if this OML works for you?


Kind regards,

Rui Barradas

OSMDb.oml

Sry. Didnt work

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