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:
SC manually called on modal show when the date picker’s date is initialised to today’s date: Feb 27, 2021.
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.
Change the date again to Feb 15, 2021 - the changed/apply event now calls SC with date Feb 04, 2021.
If you change date again, it’ll send SC request with Feb 15, 2021 - and so on…
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.
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.
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.
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:
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.