17
Views
10
Comments
Solved
Save date Reactive web
Question
Application Type
Reactive

Hi All,

I have a question relating saving a date in reactive web. I have done this before in traditional web where I got it to work.

Right now I have a List that shows questions and answer field based on the question type. I created an aggregate that gets all the questions with or without an answer. Each of my input variable is connected to its own Entity attribute (Short text answer to QuestionAnswer.List.Current.Answer.ShortText etc).

For the save actions I have used the on blur (OnChange is not working optimal as well, would be better to use though) action. If I debug my application when saving the date field I notice that the AnswerDate is always the default date (01-01-1900). So somehow it is not telling the assign before the save action what the value inside the variable is. Since I have only developed in Reactive web (where this approach works) I am stuck at this moment. 

Could anybody clarify on how to save the date? 


Best Regards,
Max

Rank: #458
Solution

Hi Max,


Using the OnBlur on that situation is not the right approach. If you want to save the answer on the date picker selection, then use the DatePicker select Event to handle that logic :) 

You will need to pass the current AnswerId and the QuestionId in order to assign the right values. I attached your OML updated with a fully working solution for that.

Best Regards,

Diogo Romero

DateSaveWorking.oml

Rank: #68

Hi Max, 

Could you replicate the problem in an OML and attach it so we can try to help you?

Rank: #10305

Here you go. 

I have created something very basic where you can create a question and it will always show a date field. 

The issue is that the 'answer' that I enter is never passed on the on blur (or onchange or whatever). 

DateSave.oap

Rank: #10305

https://maxdegroot.outsystemscloud.com/DateSave/Screen1

DateSave.oap

Rank: #458
Solution

Hi Max,


Using the OnBlur on that situation is not the right approach. If you want to save the answer on the date picker selection, then use the DatePicker select Event to handle that logic :) 

You will need to pass the current AnswerId and the QuestionId in order to assign the right values. I attached your OML updated with a fully working solution for that.

Best Regards,

Diogo Romero

DateSaveWorking.oml

Rank: #68

Max,

The DatePicker component is replacing the entry's onchange.

You can use the DatePicker DatePickerOnSelect event to save the data.

See the change I made to your OML.


DateSave.oml

Rank: #292

Hi Max,

You need to use only the DatePickerOnSelect event of the Date Picker, assign the value of the start date into the variable you want to pass (in your case Answer.AnswerDate) and pass the Answer local variable to the action SaveAnswer.

Hope it helps!