PF 11 -> 12 Datepicker is undefined

UI Components for JSF
Post Reply
oveb
Posts: 23
Joined: 20 May 2022, 14:06

01 Feb 2023, 11:15

Hi,

I'm upgrading to PF 12 from 11 and using datepicker i.e.

Code: Select all

$.datepicker.parseDate = ...

I get undefined. This worked in PF 11. I found an issue that was done on PF 12 https://github.com/primefaces/primefaces/pull/8914 to Optimize JS bundling.
I see that datepicker has been moved from jquery-plugins.js to calendar.js, so it cannot be found. I tried to use outputScript to include calendar.js but that did not work.
How can I include datepicker so its not undefined?

Thanks, any advice appreciated.

Melloware
Posts: 3717
Joined: 22 Apr 2013, 15:48

01 Feb 2023, 15:09

That is your issue we moved to calendar.js its own bundle so you need to make sure its loaded in the right order before others etc.

If you can put together a PrimeFaces Test reproducer showing the issue I can take a look: https://github.com/primefaces/primefaces-test
PrimeFaces Developer | PrimeFaces Extensions Developer
GitHub Profile: https://github.com/melloware
PrimeFaces Elite 13.0.0 / PF Extensions 13.0.0
PrimeReact 9.6.1

oveb
Posts: 23
Joined: 20 May 2022, 14:06

01 Feb 2023, 15:48

Hi,

Thanks for the quick reply. Yes it was the ordering, working fine now.
My bad.

oveb
Posts: 23
Joined: 20 May 2022, 14:06

02 Feb 2023, 10:44

Hi,

I fixed the sorting so now calendar.js is included and the datepicker works fine, but now I get "Uncaught TypeError: u._base_updateDatepicker is not a function" from calendar.js.
Without adding calendar.js I'm not getting the error.

Code: Select all

javascript 176:325 Uncaught TypeError: u._base_updateDatepicker is not a function
I have used the file from PF

Code: Select all

<h:outputScript library="primefaces" name="calendar/calendar.js"/>
Any idea why I get this error? Do I miss some files?

Melloware
Posts: 3717
Joined: 22 Apr 2013, 15:48

02 Feb 2023, 17:05

If you can create a PrimeFaces Test reproducer I can take a look. Still feels like a JS ordering issue.
PrimeFaces Developer | PrimeFaces Extensions Developer
GitHub Profile: https://github.com/melloware
PrimeFaces Elite 13.0.0 / PF Extensions 13.0.0
PrimeReact 9.6.1

hairi11
Posts: 25
Joined: 18 Apr 2016, 16:13

24 Feb 2023, 02:42

Hi. I encounter the same error.
The pattern in my case is when I navigate to other page that don't have datePicker and come back, datePicker not popping the calendar.
Its can popup again after I refresh the browser.

Thanks

Melloware
Posts: 3717
Joined: 22 Apr 2013, 15:48

24 Feb 2023, 03:37

I still need a reproducer. Or how about the error on the F12 console when it stops working?
PrimeFaces Developer | PrimeFaces Extensions Developer
GitHub Profile: https://github.com/melloware
PrimeFaces Elite 13.0.0 / PF Extensions 13.0.0
PrimeReact 9.6.1

hairi11
Posts: 25
Joined: 18 Apr 2016, 16:13

24 Feb 2023, 03:43

Melloware wrote:
24 Feb 2023, 03:37
I still need a reproducer. Or how about the error on the F12 console when it stops working?
after I do refresh in browser.

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 6 guests