Primefaces Schedule is not displayed in Application

后端 未结 2 1738
独厮守ぢ
独厮守ぢ 2020-12-21 18:31

I got a problem with the Primefaces .

It is not displayed in my Application which uses and

相关标签:
2条回答
  • 2020-12-21 19:06

    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>
    
    0 讨论(0)
  • 2020-12-21 19:10

    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

    0 讨论(0)
提交回复
热议问题