Price lists 5.2 calendar undefined

I upgrade my version of Primefaces from 3.0.1 to 5.2. Now I am with myFaces 2.2.8 and Primefaces 5.2. This update violated my perforated calendar, and I cannot figure out what happened:

I use: widgetVar="calendar"in mine p:calendar, but I can no longer access the javascript variable calendar.

Here is my sample page:

    <h:body>
    <p:calendar popupIconOnly="true"
                showOn="button"
                id="validityCalendar"
                locale="fr" 
                navigator="true"
                disabledWeekends="true" 
                style="padding-left:5px; padding-right:5px;"
                widgetVar="calendar" size="10" />
   <script type="text/javascript">
   $(function() {
    calendar.jqEl.datepicker("option", {maxDate : "11/07/2016", onChangeMonthYear : onChangeMonthYear});
   });
   </script>
</h:body>

And I get this error:

ReferenceError: calendar is not defined

I do not include another jquery or jquery-ui than the one from Primefaces. popupIconOnlydoesn't work either, but that's another topic ...

+4
source share
1 answer

ReferenceError: Undefined calendar

From PrimeFaces 4.0 you need to use PF ('widgetVar') instead of widgetVar, i.e. PF('calendar').

PopupIconOnly , ...

popupIconOnly PrimeFaces 5.0

+4

Source: https://habr.com/ru/post/1599055/


All Articles