Datepicker: Change event is not called when using mask="true"
See original GitHub issueDescribe the defect The ajax “change event” is not called when the date is type istead of being selected. The behaviour should be the same as the other inputs, the value of the input is changed and the user leaves the field, the event is called. Calendar works like this.
Environment:
- PF Version: 10.0
- JSF + version: _e.g. Mojarra 2.2.14
- Affected browsers: ALL_
To Reproduce Steps to reproduce the behavior:
- focus datepicker
- type a date and leave
- change event is not called
Expected behavior If I change the value of the datepicker typing the date then the ajax method “change” should be called.
Example XHTML
<p:datePicker mask="true"
value="#{testView.data}"
maskSlotChar=" "
pattern="dd/MM/yyyy"
monthNavigator="true"
yearNavigator="true"
showIcon="true"
showOnFocus="false">
<p:ajax event="dateSelect" listener="#{testView.onDateSelect()}"/>
<p:ajax event="change" listener="#{testView.onChange()}"/>
</p:datePicker>
Example Bean
@Named
@ViewScoped
public class TestView implements Serializable {
private Date data;
public void onDateSelect() {
System.out.println("hi date select");
}
public void onChange() {
System.out.println("hi onChange");
}
public Date getData() {
return data;
}
public void setData(Date data) {
this.data = data;
}
}
Issue Analytics
- State:
- Created 2 years ago
- Comments:17 (12 by maintainers)
Top Results From Across the Web
jQuery masked input with datepicker fires onChange event ...
Just update to the latest jQuery (1.9.0) and latest maskedInput (1.3.1). This was a bug that got resolved - Look at the change...
Read more >Datepicker not calling ajax "change" on input
I saw that calendar is deprecated, so I'm trying to move to Datepicker. I have something like: Code: Select all <p:datePicker mask="true" value= ......
Read more >Kendo UI Date Picker with DateInput change in how Mask ...
Hi, I'm Using Kendo UI Date Picker control with DateInput as true and Format as "MM-dd-yyyy". When Date Picker gets render, it shows...
Read more >DateTimePicker - XDSoft.net
Full options list ; allowTimes, [] ; mask, false, Use mask for input. true - automatically generates a mask on the field 'format',...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
It’s working now, thanks a lot 😃
I will test this in my application as soon as I find some time for it. Thanks for improving the fix. I totally agree with you (PR message), that no time should be wasted for IE anymore (even our company has switched to MS Edge Chome and our IT is really slow 😉)