1

点击提交按钮后出现问题。Primafaces 验证被执行并且日历按钮消失。应用程序视图的结构是一个包含其他页面的主体页面。在名称为“welcomePrimefaces”的主页面中,我使用ui:include调用另一个名称为 left_layoutUnit 的页面

在此处输入图像描述

我正在使用primefaces 3.5Mojarra 2.1.6

有人可以帮助我吗???

欢迎Primefaces.xhtml

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<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>                             

        <link type="text/css" rel="stylesheet" href="css/styles.css"/>

        <f:facet name="first">
            <meta content='text/html; charset=UTF-8' http-equiv="Content-Type"/>
            <title>PrimeFaces</title>
        </f:facet>                            

        <script type="text/javascript">
                function handleLoginRequest(xhr, status, args) {
                        if(args.validationFailed || !args.loggedIn) {
                                jQuery('#dialog').effect("shake", { times:3 }, 100);
                        } else {
                                dlg.hide();
                                jQuery('#loginLink').fadeOut();
                        }
                }
        </script>

    </h:head>

    <h:body>                                   

        <p:layout fullPage="true">                                

            <p:layoutUnit position="north" size="100" styleClass="ui-layout-header">                         
                <ui:include src="header_layoutUnit.xhtml" />                    
            </p:layoutUnit> 

            <p:layoutUnit id="footer" position="south" size="100" closable="false" collapsible="false">
                <ui:include src="footer_layoutUnit.xhtml" />
            </p:layoutUnit>

            <p:layoutUnit position="west" size="500" closable="false" collapsible="false">
                <ui:include src="left_layoutUnit.xhtml" />
            </p:layoutUnit>

            <p:layoutUnit position="center" styleClass="ui-layout-center">                    
                <ui:include src="right_layoutUnit.xhtml" />                                                            
            </p:layoutUnit>

        </p:layout>

    </h:body>

</f:view>

left_layoutUnit.xhtml

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html>
<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">   

<h:head>       
    <h:form id="form">        
        <p:panel id="panel" header="Panel Title">
            <p:messages id="msgs"/>
            <p:panelGrid id="theGrid" columns="1">                   



                <p:row>   
                    <p:column>                            
                        <p:calendar value="#{formBean.date1}" id="popupButtonCal1" showOn="button" maxlength="8" size="15" 
                                    required="true" requiredMessage="Fecha ida is required"/>                                                       
                    </p:column>
                </p:row>
                <p:row>   
                    <p:column>                            
                        <p:calendar value="#{formBean.date2}" id="popupButtonCal2" showOn="button" maxlength="8" size="15" 
                                    required="true" requiredMessage="Fecha vuelta is required"/>                            
                    </p:column>
                </p:row>                                            

                <p:dialog header="Selected Dates" widgetVar="dialog" showEffect="fade" hideEffect="fade">   
                    <h:panelGrid id="display" columns="1">
                        <h:outputText value="Popup Button Date: " />  
                        <h:outputText id="popupButtonDate">  
                            <f:convertDateTime pattern="d/M/yyyy"/>  
                        </h:outputText>                  
                    </h:panelGrid>
                </p:dialog>                                        

                <p:row>   
                    <p:column>
                        <p:commandButton value="Submit" update="panel" actionListener="#{formBean.buscarVuelos}"/>
                    </p:column>
                </p:row>

            </p:panelGrid>      
        </p:panel>                        
    </h:form>
</h:head>

4

0 回答 0