[OutSystems UI Web] DatePicker is causing an OnChange event on it's bounded Input during initialization

Forge Component
(57)
Published on 18 May by OutSystems R&D
57 votes
Published on 18 May by OutSystems R&D

I have a search page that has 12 datetime pickers. I noticed that after implementing the DatePicker widget that my search engine receives requests when the page is loaded. After some investigation I found out that the DatePicker is triggering an OnChange event after initialization. Since I have 12 of these widgets I get a lot of extra and unneeded traffic on backend. 

How can I prevent the initial OnChange event or is this a bug?

Demo OML attached and visible here: https://vkoning.outsystemscloud.com/DatePickerOnChangedemo/Entry1.aspx?_ts=637208252040813210


Hi Vincent

Why don't you just use the onselected calendar event instead of the onchange event? I've tried it and typing into it does trigger the onselected event anyway



Clearing the date isn't triggering the OnSelected event. And this is a requirement so I need to catch the OnChange event.

try using onchange

Salman Ansari wrote:

try using onchange

I do as stated in the post directly above you.....


Vincent Koning wrote:

Salman Ansari wrote:

try using onchange

I do as stated in the post directly above you.....



Let me clear below point
1.Do you want not to fire OnChange event on datepicker change?
2.You need to pick the event when you clear the date?

Hi Salman,

I need both. I need to OnSelected event from the DatePicker when someone enters a date (to initiate a search without any user input). And I need the OnChange event from the input to catch the clearing of the date field ( also to initiate the search).

Note that one of our requirements is that the search starts the moment someone changes one of the search fields.