Hi,
It's me again :-)
When using the new datepicker in combination with the editable client action, we have noticed that if you type in the date, and click somewhere else on the page to close the datepicker, the datepicker component does not output the OnSelected Event.
Which results in a red border on a required datefield in our form when validating it, but the user thinks he has already entered the date.
Is there a way to solve this on our end or is this a bug?
Kind regards,
Bas
Hi @Bas de Jong Can you please check my sample?Hope it helps.
Cheers,GM
Hey,
Thanks for the sample. That actually works, but my usecase is a little bit different . Instead of the alert in your sample i actually want to grab the date that was entered in the input field and let the DatePicker select action run.
I have attached the OML
according to the flatpickr documentation i have made 3 input parameters of type object in my client action:
https://flatpickr.js.org/events/#hooks
Thanks for your help so far!
Thanks!!! the key was that the platform automatically added/autocompleted the brackets:
i initially had this:
$parameters.OnClose = $actions.HandleDatePickerClosed();
instead of:
$parameters.OnClose = $actions.HandleDatePickerClosed;
Hi @Bas de Jong
That is the default behaviour from the flatpickr library, not a bug (actually it changes when using Enter on the input).However, you can add an on close event using the extensibility actions (SetFlatpickrEvent/UnsetFlatpickrEvent) in this case to achieve that use case.
You can get some documentation (also available on the Documentation tab of the component) here:
Hope it helps!
Thanks for your answer. I tried registering the onClose event, but i run into some errors:
My flow:
it looks like this callback is only triggered once, when initializing the component. Any further callbacks result in the uncaught type error.
Hi @Bas de Jong,
Is it possible to share the oml with that implementation?
Tks in advance,
JR
In the assignment, you're calling the action instead of a simple assignment :)
Correct! Is a common mistake don't worry.Glad to know it could help. I really advise taking a look at these new features since in an iterative way we're providing more and more extensibility power to the developers on these components using providers on a more low code way :)