Problem with DMX Date Picker Changed & Apply Dynamic Events

Wappler v3.8.1
Win 10 Pro

Dynamic Evens of changed and apply on dmx-date-picker are not working as expected. Our setup included only one of those being used at a time - both has problems, hence reporting together.

Steps to reproduce:

  1. SC manually called on modal show when the date picker’s date is initialised to today’s date: Feb 27, 2021.
  2. When we change the date to say, Feb 04, 2021 - the changed/apply event (both options were tried in separate attempts, not together) does call the SC but with the date as before: Feb 27, 2021.
  3. Change the date again to Feb 15, 2021 - the changed/apply event now calls SC with date Feb 04, 2021.
  4. If you change date again, it’ll send SC request with Feb 15, 2021 - and so on…

Please fix.

this is how the dmx-date-picker is configured.

<input is="dmx-date-picker" name="GetDate" id="GetDate" placeholder=" " class="inputFloat form-control text-center font-size-x-large" autocomplete="off" dmx-bind:value="varDateTime.datetime"
dmx-bind:maxdate="varDateTime.datetime" format="YYYY-MM-DD" dmx-bind:mindate="'2020-11-01'" dmx-on:apply="scGetEarnedHours.load({param1: varParam1.value, param2: value})">

varDateTime = plain old date time var to get current date.

What exactly are you trying to achieve? Apply event is triggered when you click the apply button of the picker, when a date range is selected.
So - what is your goal on the page?

goal is to call server connect with the selected date.
for this our pref is to use changed event. but we tried apply as well - on date selection in a simple (non-range) dmx-date-picker does call the apply event as we can see the SA getting called.
updated event works as expected - the problem we have highlighted in step 2-4 does not happen with updated - but our use case requires the SC to be called when user explicitly changes date from the picker, not when some other action is updating the date input box.

So use the updated event, it is triggered when the date is updated in the picker.

updated event is triggered when the value changes in the input box. we do not want that.

we want to trigger the SC only when user changes the value in date picker himself - for which the changed event is perfect - except it is not working as expected. the problem is described in steps 2-4 above.

The updated event triggers when the user changes the date, that is the event you need to use.

updated event is getting triggered even when date is not changed by user but by another action e.g. if on a button click we set the value of the date input to another date.

but changed and apply events are not getting triggered when value is updated elsewhere.

this is PHP SPA project btw.

It will trigger in both cases. Updated is a special App Connect event, which is triggered when the data is changed - either by user or not.

yes, right.
but in this use case we do not want that.

we want to trigger only when user changes something. for this use, we believe changed or apply are the right App Connect dynamic events. but it is not working as expected with Wappler v3.8.1 on PHP SPA project. hence this bug report.

There is no bug with apply event.
Apply event is used with date range picker, where you select a range and click the Apply button:

Screenshot 2021-02-27 at 9.40.57

It’s not to be used for single date picker.
Change event won’t work in this case and this has been discussed quite lot of times in the community. You need to use the updated event.

got it.

changed = may pass the old value, may pass the new!
updated = always the new value.

thank you.