How to manipulate a Date Picker with the Enter Key?
In my last project there was a requirement of having a date filter associated with a date picker with default date. It is important to mention that the used date picker is part of Web Patterns, from the 10th version of OutSystems.
The filter’s purpose was to allow the user to choose a date using either the date picker or to insert it manually.
Since the input is associated with an On-Change event, whenever the user choose to insert, manually, a date and press the Enter key, an automatic reset of the input occurs (see the attached demo video).
Many approaches were tried, without success, such as using javascript to disable Enter key from the input or using default button with a dummy action. To disable the Enter key from the input, we would had to change the widget’s javascript library, an option which we discarded due to maintenance problems.
We also pondered changing to Rich Widgets’ Date Picker, but this idea was also discarded, because the widget will be discontinued soon.
How did we solve it
The solution relied on using Javascript, JQuery and invisible buttons.
I hope this small document can be useful to you in similar situations.