Primefaces Schedule is not displayed in Application

冷暖自知 提交于 2019-11-29 17:06:21

Problem Solved:

Search in your Application for Menuitems or Components which uses Ajax. If you don't need it, disable Ajax with ajax="false" and your <p:schedule> is displayed.

Source

Months ago, I learned the same as well, to use ajax="false" on pages where p:schedule exist, but if absolutely necessary, your page does 'not' need to disable AJAX (ajax="false").

My page below, renders a menu with where ajax="false", but also, it has p:calendar and p:commandButton's to update the month view of p:schedule.

<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:p="http://primefaces.org/ui"
      xmlns:pe="http://primefaces.org/ui/extensions"
      xmlns:o="http://omnifaces.org/ui"
      xmlns:of="http://omnifaces.org/functions">

    <ui:composition>

        <pe:layoutPane position="north">
            <ui:include src="/orders/pf_BrowseLayoutPaneHeaderFacet.xhtml"/>

            <h:form id="ordersScheduleForm_north" >

                <ui:include src="/orders/pf_BrowseMenu.xhtml"/>

                <h:panelGrid columns="2" width="100%">
                    <h:panelGroup layout="block" style="text-align: left !important;" >
                        <h:panelGrid columns="3" cellspacing="5">
                            <h:outputText value="Select Date:" />
                            <p:calendar value="#{pf_ordersController.filterTripDateFrom}"
                                        mode="popup" showOn="button"
                                        navigator="true" effect="fadeIn" pattern="MM/dd/yyyy" size="12">
                                <p:ajax partialSubmit="false" event="dateSelect"
                                        listener="#{pf_ordersController.filterTripDateFromSelected}"
                                        update=":ordersScheduleForm_north :ordersScheduleForm_center"
                                        oncomplete="ordersSchedule.update();"/>
                            </p:calendar>
                        </h:panelGrid>
                    </h:panelGroup>

                    <h:panelGroup layout="block">
                        <h:panelGrid columns="2" width="100%">
                            <h:panelGroup style="text-align: left !important; font-size: larger !important;">
                                <h:outputText value="#{pf_ordersController.filterTripDateFrom}">
                                    <f:convertDateTime pattern="MMMM yyyy" />
                                </h:outputText>
                            </h:panelGroup>

                            <h:panelGroup layout="block" style="text-align: right !important;" >
                                <p:commandButton value="Previous" icon="ui-icon-arrowthick-1-w"
                                                actionListener="#{pf_ordersController.previousScheduleMonth()}"
                                                update=":ordersScheduleForm_north :ordersScheduleForm_center"
                                                oncomplete="ordersSchedule.update();"/>
                                <p:commandButton value="Next" icon="ui-icon-arrowthick-1-e"
                                                actionListener="#{pf_ordersController.nextScheduleMonth()}"
                                                update=":ordersScheduleForm_north :ordersScheduleForm_center"
                                                oncomplete="ordersSchedule.update();"/>
                            </h:panelGroup>
                        </h:panelGrid>

                    </h:panelGroup>

                </h:panelGrid>

            </h:form>

        </pe:layoutPane>

        <pe:layoutPane position="center">

            <h:form id="ordersScheduleForm_center" >

                <p:messages id="formMessages" showDetail="true" showSummary="false" globalOnly="false" />

                <p:schedule draggable="false" widgetVar="ordersSchedule"
                            aspectRatio="0.30" showHeader="false" view="month"
                            initialDate="#{pf_ordersController.filterTripDateFrom}"
                            value="#{pf_ordersController.lazyEventModel}">
                    <p:ajax partialSubmit="false" event="eventSelect"
                            listener="#{pf_ordersController.onEventSelect}"
                            update=":pageContentPanel"/>
                </p:schedule>

            </h:form>

        </pe:layoutPane>

    </ui:composition>

</html>
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!