primefaces日历按钮在验证后消失

时间:2013-05-03 18:25:39

标签: ajax primefaces

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

调用另一个名称为left_layoutUnit的页面

enter image description here

我正在使用 primefaces 3.5 Mojarra 2.1.6

有人可以帮助我???

welcomePrimefaces.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>

0 个答案:

没有答案