Primefaces 计划未显示在应用程序中 [英] Primefaces Schedule is not displayed in Application

查看:16
本文介绍了Primefaces 计划未显示在应用程序中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Primefaces 有问题.

I got a problem with the Primefaces <p:schedule>.

它没有显示在我使用 标签的应用程序中.但是,如果我将计划放在没有这些标签组合的独立页面中,它会按预期工作.

It is not displayed in my Application which uses <ui:include> and <ui:composition> Tags. But if I place the Schedule in a Standalone Page without these Tag Combination, it works as expected.

我的 app.xhtml 页面包含一个由 组件定义的布局.我在左侧定义了一个带有 <f:ajax> 标签的菜单,以便每次单击菜单时都会更新 contentPanel.

My app.xhtml Page includes a Layout which is defined by the <p:Layout> Component. I define a Menu at the left side with a <f:ajax> Tag, so that a contentPanel get updated on each click in the menu.

被包含的这些页面之一是 hldyplanning.xhtml - 在这个页面中应该显示一个 .为了测试,我创建了一个新站点.test.xhtml.我决定实施 Primefaces ShowCase Example 来测试它.

One of these Pages which gets included, is the hldyplanning.xhtml - in this Page a <p:schedule> should be displayed. For testing I create a new site. The test.xhtml. I decide to implement the Primefaces ShowCase Example for testing it.

我希望我做错了什么,而不是错误或类似的东西.

I hope that I'm doing something wrong and it is not a Bug or something like that.

这是app.xhtml:

<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:p="http://primefaces.org/ui">

    <f:view contentType="text/html">
        <h:head>
            <f:facet name="first">
                <meta content='text/html; charset=UTF-8' http-equiv="Content-Type"/>
                <meta http-equiv="refresh" content="#{session.maxInactiveInterval};url=/LEAN" />
                <title>Lean - Menü</title> 
            </f:facet>
        </h:head>

        <h:body style="background: white;">

            <p:layout fullPage="true">

                <p:layoutUnit position="west" size="175" header="Menü" collapsible="true" style="background: wheat;">
                    <h:form id="frm_menu">
                        <f:ajax render=":contentPanel" execute="@this">
                            <p:menu model="#{appController.menu}" style="font-size: 12px; width: 96%" />                                
                        </f:ajax>
                    </h:form>
                </p:layoutUnit>

                <p:layoutUnit position="center" style="background: wheat;">
                    <h:panelGroup id="contentPanel">
                        <ui:include src="#{appController.content}.xhtml" />
                    </h:panelGroup>
                </p:layoutUnit>

            </p:layout>

            <p:growl autoUpdate="true" showDetail="true"/>

        </h:body>

    </f:view>
</html>

appController.java

package lean.controller.view;


import java.util.Map;
import javax.annotation.PostConstruct;
import javax.el.ExpressionFactory;
import javax.el.MethodExpression;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.RequestScoped;
import javax.faces.context.FacesContext;
import javax.servlet.http.HttpServletResponse;
import org.primefaces.model.DefaultMenuModel;
import org.primefaces.model.MenuModel;
import org.primefaces.component.menuitem.MenuItem;  
import org.primefaces.component.submenu.Submenu;  

@ManagedBean
@RequestScoped
public class AppController {

    private String content = "/app/includes/dashboard";

    private MenuModel menu;
    private Submenu submenu;
    private MenuItem item;

    final private String[] submenu_urlb = { "Urlaubsübersicht", "/app/includes/urlaubsubersicht", 
                                            "Urlaubsplanung", "/app/includes/hldyplanning", 
                                            "Abteilungsübersicht", "/app/includes/abt_ubersicht", 
                                            "Persönliche Übersicht", "/app/includes/per_uberischt",
                                            "Urlaubsanträge", "/app/includes/urlaubsantrage"};

    FacesContext fc;
    ExpressionFactory exfactory;
    HttpServletResponse response;
    Map cookieMap;
    MethodExpression me;

    //<editor-fold defaultstate="collapsed" desc="GETTER UND SETTER">

    public MenuModel getMenu(){
        return menu;
    }

    public MethodExpression getMe() {
        return me;
    }

    public void setMe(MethodExpression me) {
        this.me = me;
    }

    public ExpressionFactory getExfactory() {
        return exfactory;
    }

    public void setExfactory(ExpressionFactory exfactory) {
        this.exfactory = exfactory;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public FacesContext getFc() {
        return fc;
    }

    public void setFc(FacesContext fc) {
        this.fc = fc;
    }

    public HttpServletResponse getResponse() {
        return response;
    }

    public void setResponse(HttpServletResponse response) {
        this.response = response;
    }

    public Map getCookieMap() {
        return cookieMap;
    }

    public void setCookieMap(Map cookieMap) {
        this.cookieMap = cookieMap;
    }

    //</editor-fold>



    /**
     *
     */
    @PostConstruct
    public void init() {

        setFc(FacesContext.getCurrentInstance());
        setResponse((HttpServletResponse) FacesContext.getCurrentInstance().getExternalContext().getResponse());
        setCookieMap(FacesContext.getCurrentInstance().getExternalContext().getRequestCookieMap());
        setExfactory(FacesContext.getCurrentInstance().getApplication().getExpressionFactory());


        menu = new DefaultMenuModel();

        //erstes Submenu erzeugen

        submenu = new Submenu();
        submenu.setLabel("Urlaubsplanung");

        for(int i = 0; i <= (submenu_urlb.length-1); i=i+2){
            item = new MenuItem();  
            item.setValue(submenu_urlb[i]);
            setMe(getExfactory().createMethodExpression( fc.getELContext(), "#{appController.doNav(""+submenu_urlb[i+1]+"")}", void.class, new Class[0]));
            item.setActionExpression(me);
            item.setUpdate(":contentPanel");
            submenu.getChildren().add(item);
        }

        menu.addSubmenu(submenu);

        //zweites Submenu erzeugen
        submenu = new Submenu();
        submenu.setLabel("Account");

        item = new MenuItem();  
        item.setValue("Dashboard");
        setMe(getExfactory().createMethodExpression( fc.getELContext(), "#{appController.doNav("/app/includes/dashboard")}", void.class, new Class[0]));
        item.setActionExpression(me);
        item.setUpdate(":contentPanel");
        submenu.getChildren().add(item);


        item = new MenuItem();  
        item.setValue("Ausloggen");
        setMe(getExfactory().createMethodExpression( fc.getELContext(), "#{appController.menuitem_logout()}", void.class, new Class[0]));
        item.setActionExpression(me);
        item.setUpdate(":contentPanel");
        submenu.getChildren().add(item);

        menu.addSubmenu(submenu);

    }

    public String menuitem_logout(){

        FacesContext.getCurrentInstance().getExternalContext().invalidateSession();
        return "backToStart";

    }

    public void doNav(String nav){

        setContent(nav);

    }
}

hldyplanning.xhtml

<?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">
<ui:composition 
    xmlns="http://www.w3.org/1999/xhtml"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:ui="http://java.sun.com/jsf/facelets"
    xmlns:p="http://primefaces.org/ui">

    <h:form id="frm_urlbubersicht">

        <p:panelGrid style="width: 100%;">
            <f:facet name="header">
                <p:row>
                    <p:column colspan="2" style="height:50px;">
                        Urlaubsplanung
                    </p:column>
                </p:row>
            </f:facet>
            <p:row>
                <p:column style="width: 420px;" colspan="1">
                    <p:panel style="font-size: 12px; width: 420px; position: relative; border: 1px solid gray">

                        <f:facet name="header">
                            Urlaubsantrag Formular
                        </f:facet>

                    <p:panelGrid id="pnl_userinfo" style="font-size: 12px; width: 400px; border: 1px solid gray">

                        <f:facet name="header">  
                            <p:row>
                                <p:column colspan="2">Persönliche Informationen</p:column>
                            </p:row>
                        </f:facet>
                        <p:row>
                            <p:column style="width:120px">
                                <h:outputText value="Name:"/>
                            </p:column>
                            <p:column>
                                <h:outputText value="#{loginController.sessionData.user_name}" />
                            </p:column>
                        </p:row>
                        <p:row>
                            <p:column style="width:120px">
                                <h:outputText value="Team:" />
                            </p:column>
                            <p:column>
                                <h:outputText value="#{loginController.sessionData.teams_name}" />
                            </p:column>
                        </p:row>
                    </p:panelGrid>
                    <br/>
                    <p:panelGrid id="pnl_time" style="font-size: 12px; width: 400px; border: 1px solid gray">
                        <f:facet name="header">  
                            <p:row>
                                <p:column colspan="2">Zeitraum</p:column>
                            </p:row>
                        </f:facet>
                        <p:row>
                            <p:column style="width:120px">
                                <p:outputLabel for="cld_startdate" value="Startdatum:" />
                            </p:column>
                            <p:column>
                                <p:calendar value="#{hldyPlanningController.startdate}" id="cld_startdate" showOn="button" pattern="dd.MM.yyyy" required="true" requiredMessage=""/>
                            </p:column>
                        </p:row>
                        <p:row>
                            <p:column style="width:120px">
                                <p:outputLabel for="cld_enddate" value="Enddatum:" />
                            </p:column>
                            <p:column>
                                <p:calendar value="#{hldyPlanningController.enddate}" id="cld_enddate" showOn="button" pattern="dd.MM.yyyy" required="true" requiredMessage=""/>
                            </p:column>             
                        </p:row>
                    </p:panelGrid>
                    <br/>
                    <p:panelGrid id="pnl_misc" style="font-size: 12px; width: 400px; border: 1px solid gray">
                        <f:facet name="header">  
                            <p:row>
                                <p:column colspan="2">Weiteres</p:column>
                            </p:row>
                        </f:facet>
                        <p:row>
                            <p:column style="width:120px">
                                <p:outputLabel for="opt_hType" value="Typ:"/>
                            </p:column>
                            <p:column>
                                <p:selectOneButton value="#{hldyPlanningController.type}" id="opt_hType">  
                                    <f:selectItem itemLabel="Urlaub" itemValue="U" />  
                                    <f:selectItem itemLabel="Absetzen" itemValue="A" />  
                                </p:selectOneButton> 
                            </p:column>
                        </p:row>
                        <p:row>
                            <p:column style="width:120px">
                                <p:outputLabel for="txta_note" value="Bemerkung:"/>
                            </p:column>
                            <p:column>
                                <p:inputTextarea maxlength="45" rows="2" cols="30" value="#{hldyPlanningController.note}" id="txta_note"/>  
                            </p:column>
                        </p:row>
                    </p:panelGrid>                    
                    <br/>
                    <p:panelGrid id="pnl_actions" style="font-size: 12px; width: 400px; border: 1px solid gray">
                        <f:facet name="header">  
                            <p:row>
                                <p:column colspan="2">Aktion</p:column>
                            </p:row>
                        </f:facet>
                        <p:row>
                            <p:column>
                                <h:commandButton id="btn_plan" value="Planen" action="#{hldyPlanningController.sendAFL()}" style="width: 170px; height: 30px"/>
                            </p:column>
                            <p:column>
                                <h:commandButton id="btn_submit" value="Beantragen" action="#{hldyPlanningController.sendAFL()}" style="width: 170px; height: 30px" />
                            </p:column>
                        </p:row>
                    </p:panelGrid>
                    </p:panel>                    
                </p:column>
                <p:column colspan="1" style="vertical-align: top;">
                    <p:panel style="font-size: 12px; border: 1px solid gray;">
                        <f:facet name="header">
                            Mitarbeiter, die in diesem Zeitraum auch Urlaub geplant haben
                        </f:facet>

                    </p:panel>

                </p:column>
            </p:row>     
        </p:panelGrid>

        <p:schedule value="#{calendarController.eventModel}" widgetVar="myschedule">  

        </p:schedule>  

        <p:dialog widgetVar="eventDialog" header="Event Details" showEffect="clip" hideEffect="clip">  
            <h:panelGrid id="eventDetails" columns="2">  
                <h:outputLabel for="title" value="Title:" />  
                <p:inputText id="title" value="#{calendarController.event.title}" required="true"/>  
                <h:outputLabel for="from" value="From:" />  
                <p:inputMask id="from" value="#{calendarController.event.startDate}" mask="99/99/9999">  
                    <f:convertDateTime pattern="dd/MM/yyyy" />  
                </p:inputMask>  
                <h:outputLabel for="to" value="To:" />  
                <p:inputMask id="to" value="#{calendarController.event.endDate}" mask="99/99/9999">  
                    <f:convertDateTime pattern="dd/MM/yyyy" />  
                </p:inputMask>  
                <h:outputLabel for="allDay" value="All Day:" />  
                <h:selectBooleanCheckbox id="allDay" value="#{calendarController.event.allDay}" />  
                <p:commandButton type="reset" value="Reset" />  
                <p:commandButton value="Save" actionListener="#{calendarController.addEvent}" oncomplete="myschedule.update();eventDialog.hide();"/>  
            </h:panelGrid>  
        </p:dialog>

    </h:form>

</ui:composition>

test.xhtml

<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:p="http://primefaces.org/ui">

    <f:view contentType="text/html">
        <h:head>
            <f:facet name="first">
                <meta content='text/html; charset=UTF-8' http-equiv="Content-Type"/>
                <title>TEST</title> 
            </f:facet>
        </h:head>
        <h:body>
            <h:form>  

                <p:growl id="messages" showDetail="true" />  

                <p:schedule value="#{calendarController.eventModel}" widgetVar="myschedule">  

                    <p:ajax event="dateSelect" listener="#{calendarController.onDateSelect}" update="eventDetails" oncomplete="eventDialog.show()" />  
                    <p:ajax event="eventSelect" listener="#{calendarController.onEventSelect}" update="eventDetails" oncomplete="eventDialog.show()" />  
                    <p:ajax event="eventMove" listener="#{calendarController.onEventMove}" update="messages" />  
                    <p:ajax event="eventResize" listener="#{calendarController.onEventResize}" update="messages" />  

                </p:schedule>  

                <p:dialog widgetVar="eventDialog" header="Event Details" showEffect="clip" hideEffect="clip">  
                    <h:panelGrid id="eventDetails" columns="2">  
                        <h:outputLabel for="title" value="Title:" />  
                        <p:inputText id="title" value="#{calendarController.event.title}" required="true"/>  
                        <h:outputLabel for="from" value="From:" />  
                        <p:inputMask id="from" value="#{calendarController.event.startDate}" mask="99/99/9999">  
                            <f:convertDateTime pattern="dd/MM/yyyy" />  
                        </p:inputMask>  
                        <h:outputLabel for="to" value="To:" />  
                        <p:inputMask id="to" value="#{calendarController.event.endDate}" mask="99/99/9999">  
                            <f:convertDateTime pattern="dd/MM/yyyy" />  
                        </p:inputMask>  
                        <h:outputLabel for="allDay" value="All Day:" />  
                        <h:selectBooleanCheckbox id="allDay" value="#{calendarController.event.allDay}" />  
                        <p:commandButton type="reset" value="Reset" />  
                        <p:commandButton value="Save" actionListener="#{calendarController.addEvent}" oncomplete="myschedule.update();eventDialog.hide();"/>  
                    </h:panelGrid>  
                </p:dialog>  
            </h:form> 
        </h:body>
    </f:view>
</html>

calendarController.java

package lean.controller.view;

import java.io.Serializable;
import java.util.Calendar;
import java.util.Date;
import java.util.List;
import javax.annotation.PostConstruct;

import javax.faces.application.FacesMessage;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.SessionScoped;
import javax.faces.context.FacesContext;
import javax.faces.event.ActionEvent;
import lean.dataobjects.HolidayDataObj;

import org.primefaces.event.DateSelectEvent;
import org.primefaces.event.ScheduleEntryMoveEvent;
import org.primefaces.event.ScheduleEntryResizeEvent;
import org.primefaces.event.ScheduleEntrySelectEvent;
import org.primefaces.model.DefaultScheduleEvent;
import org.primefaces.model.DefaultScheduleModel;
import org.primefaces.model.LazyScheduleModel;
import org.primefaces.model.ScheduleEvent;
import org.primefaces.model.ScheduleModel;

@ManagedBean(name = "calendarController")
@SessionScoped
public class CalendarController implements Serializable {

        private ScheduleModel eventModel;
        private List<HolidayDataObj> holidayData;

        private ScheduleModel lazyEventModel;

        private ScheduleEvent event = new DefaultScheduleEvent();

        @PostConstruct
        public void init() {
                eventModel = new DefaultScheduleModel();
                eventModel.addEvent(new DefaultScheduleEvent("Champions League Match", previousDay8Pm(), previousDay11Pm()));
                eventModel.addEvent(new DefaultScheduleEvent("Birthday Party", today1Pm(), today6Pm()));
                eventModel.addEvent(new DefaultScheduleEvent("Breakfast at Tiffanys", nextDay9Am(), nextDay11Am()));
                eventModel.addEvent(new DefaultScheduleEvent("Plant the new garden stuff", theDayAfter3Pm(), fourDaysLater3pm()));

                try {
                    holidayData = lean.sql.QueryMySQL.getHolidaysForAll();

                for(int i=0; i<=holidayData.size()-1; i++ ) {
                    eventModel.addEvent( new DefaultScheduleEvent(holidayData.get(i).getUser_name(),holidayData.get(i).getHldy_startdate(),holidayData.get(i).getHldy_enddate()));
                }                    


                }catch(Exception e){
                    FacesContext.getCurrentInstance().addMessage(null, new FacesMessage(FacesMessage.SEVERITY_ERROR, "HolidayCollector ", e.getMessage()));
                }

                lazyEventModel = new LazyScheduleModel() {

                        @Override
                        public void loadEvents(Date start, Date end) {
                                clear();

                                Date random = getRandomDate(start);
                                addEvent(new DefaultScheduleEvent("Lazy Event 1", random, random));

                                random = getRandomDate(start);
                                addEvent(new DefaultScheduleEvent("Lazy Event 2", random, random));
                        }       
                };
        }

        public Date getRandomDate(Date base) {
                Calendar date = Calendar.getInstance();
                date.setTime(base);
                date.add(Calendar.DATE, ((int) (Math.random()*30)) + 1);        //set random day of month

                return date.getTime();
        }

        public Date getInitialDate() {
                Calendar calendar = Calendar.getInstance();
                calendar.set(calendar.get(Calendar.YEAR), Calendar.FEBRUARY, calendar.get(Calendar.DATE), 0, 0, 0);

                return calendar.getTime();
        }

        public ScheduleModel getEventModel() {
                return eventModel;
        }

        public ScheduleModel getLazyEventModel() {
                return lazyEventModel;
        }

        private Calendar today() {
                Calendar calendar = Calendar.getInstance();
                calendar.set(calendar.get(Calendar.YEAR), calendar.get(Calendar.MONTH), calendar.get(Calendar.DATE), 0, 0, 0);

                return calendar;
        }

        private Date previousDay8Pm() {
                Calendar t = (Calendar) today().clone();
                t.set(Calendar.AM_PM, Calendar.PM);
                t.set(Calendar.DATE, t.get(Calendar.DATE) - 1);
                t.set(Calendar.HOUR, 8);

                return t.getTime();
        }

        private Date previousDay11Pm() {
                Calendar t = (Calendar) today().clone();
                t.set(Calendar.AM_PM, Calendar.PM);
                t.set(Calendar.DATE, t.get(Calendar.DATE) - 1);
                t.set(Calendar.HOUR, 11);

                return t.getTime();
        }

        private Date today1Pm() {
                Calendar t = (Calendar) today().clone();
                t.set(Calendar.AM_PM, Calendar.PM);
                t.set(Calendar.HOUR, 1);

                return t.getTime();
        }

        private Date theDayAfter3Pm() {
                Calendar t = (Calendar) today().clone();
                t.set(Calendar.DATE, t.get(Calendar.DATE) + 2);         
                t.set(Calendar.AM_PM, Calendar.PM);
                t.set(Calendar.HOUR, 3);

                return t.getTime();
        }

        private Date today6Pm() {
                Calendar t = (Calendar) today().clone();
                t.set(Calendar.AM_PM, Calendar.PM);
                t.set(Calendar.HOUR, 6);

                return t.getTime();
        }

        private Date nextDay9Am() {
                Calendar t = (Calendar) today().clone();
                t.set(Calendar.AM_PM, Calendar.AM);
                t.set(Calendar.DATE, t.get(Calendar.DATE) + 1);
                t.set(Calendar.HOUR, 9);

                return t.getTime();
        }

        private Date nextDay11Am() {
                Calendar t = (Calendar) today().clone();
                t.set(Calendar.AM_PM, Calendar.AM);
                t.set(Calendar.DATE, t.get(Calendar.DATE) + 1);
                t.set(Calendar.HOUR, 11);

                return t.getTime();
        }

        private Date fourDaysLater3pm() {
                Calendar t = (Calendar) today().clone();
                t.set(Calendar.AM_PM, Calendar.PM);
                t.set(Calendar.DATE, t.get(Calendar.DATE) + 4);
                t.set(Calendar.HOUR, 3);

                return t.getTime();
        }

        public ScheduleEvent getEvent() {
            System.out.println("Getting event: " + event.getId() + " " + event.getTitle());
                return event;
        }

        public void setEvent(ScheduleEvent event) {
            System.out.println("Setting event");
                this.event = event;
        }

        public void addEvent(ActionEvent actionEvent) {
            System.out.println("Adding event");
                if(event.getId() == null){
                        eventModel.addEvent(event);}
                else{
                        eventModel.updateEvent(event);
                }
                event = new DefaultScheduleEvent();
                System.out.println("");
        }

        public void onEventSelect(ScheduleEntrySelectEvent selectEvent) {
            System.out.println("Selected event");
                event = selectEvent.getScheduleEvent();
        }

        public void onDateSelect(DateSelectEvent selectEvent) {
            System.out.println("Selected date");
                event = new DefaultScheduleEvent("", selectEvent.getDate(), selectEvent.getDate());
        }

        public void onEventMove(ScheduleEntryMoveEvent event) {
            System.out.println("Moved event");
                FacesMessage message = new FacesMessage(FacesMessage.SEVERITY_INFO, "Event moved", "Day delta:" + event.getDayDelta() + ", Minute delta:" + event.getMinuteDelta());

                addMessage(message);
        }

        public void onEventResize(ScheduleEntryResizeEvent event) {
            System.out.println("Resized event");
                FacesMessage message = new FacesMessage(FacesMessage.SEVERITY_INFO, "Event resized", "Day delta:" + event.getDayDelta() + ", Minute delta:" + event.getMinuteDelta());

                addMessage(message);
        }

        private void addMessage(FacesMessage message) {
                FacesContext.getCurrentInstance().addMessage(null, message);
        }
}

推荐答案

几个月前,我也学会了同样的方法,在存在 p:schedule 的页面上使用 ajax="false",但如果绝对必要,您的页面也可以'不需要' 需要禁用 AJAX (ajax="false").

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").

我下面的页面呈现了一个带有 where ajax="false" 的菜单,而且还有 p:calendar 和 p:commandButton 来更新 p:schedule 的月视图.

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>

这篇关于Primefaces 计划未显示在应用程序中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆