环境
我们在从一个页面导航到另一个页面时使用模态对话框。
这是一个简单的测试案例场景:
1.commonInclude.xhtml
这是一个commonInclude xhtml。它具有p:对话模式的代码。
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"
[<!ENTITY nbsp " ">]>
<html lang="en"
xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://xmlns.jcp.org/jsf/html"
xmlns:f="http://xmlns.jcp.org/jsf/core"
xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
xmlns:p="http://primefaces.org/ui"
xmlns:c="http://xmlns.jcp.org/jsp/jstl/core"
xmlns:o="http://omnifaces.org/ui">
<f:view locale="#{localeBean.locale}" contentType="text/html" encoding="ISO-8859-1">
<h:head>
<meta http-equiv="X-UA-Compatible" content="IE=Edge"/>
<title>
<ui:insert name="title">Default Title</ui:insert>
</title>
<h:outputStylesheet name="components.css" library="primefaces" />
<h:outputScript name="jquery/jquery.js" library="primefaces"/>
<h:outputScript name="jquery/jquery-plugins.js" library="primefaces"/>
<h:outputScript name="core.js" library="primefaces"/>
<h:outputScript name="components.js" library="primefaces"/>
</h:head>
<ui:insert name="metadata"/>
<h:body id="entirePageBody" style="margin:auto;margin-top:0;text-align:center;">
<p:dialog widgetVar="ajax_status_dialog" modal="true" draggable="false" closable="false" resizable="false" showHeader="false">
<h:outputText value="This is a Modal Dialog." />
</p:dialog>
<p:ajaxStatus id="ajaxStatusPanel" onstart="PF('ajax_status_dialog').show()" oncomplete="PF('ajax_status_dialog').hide();" />
</h:body>
</f:view>
2。 Page1.xhtml - 第一页。它有'下一步'命令按钮
<!DOCTYPE html [<!ENTITY nbsp " ">]>
<ui:composition xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://xmlns.jcp.org/jsf/html" xmlns:f="http://xmlns.jcp.org/jsf/core"
xmlns:ui="http://xmlns.jcp.org/jsf/facelets" xmlns:c="http://xmlns.jcp.org/jsp/jstl/core"
xmlns:p="http://primefaces.org/ui" xmlns:of="http://omnifaces.org/functions" xmlns:o="http://omnifaces.org/ui" xmlns:jsf="http://xmlns.jcp.org/jsf"
template="/WEB-INF/faces/template/commonInclude.xhtml">
<ui:param name="_pageTitle" value="sampleFirstPage"/>
<ui:define name="content">
<h:form id=firstpageform" prependId="false">
<c:set var="testController" value="#{testController}" scope="request"/>
<c:set var="controllerBean" value="#{testController.controllerBean}" scope="request"/>
<p:messages closable="true" escape="false"/>
<h:panelGroup layout="block"><h:outputText value="My First Page"/></h:panelGroup>
<br/>
<br/>
<p:panelGrid>
<p:row>
<p:column><h:outputText value="Welcome to First Page"/>. </p:column>
</p:row>
</p:panelGrid>
<br/>
<br/>
<p:panelGrid styleClass="button">
<p:row>
<p:column>
<p:commandButton value="Next" action="#{testController.nextCont}" update="@form" id="method"/>
</p:column>
</p:row>
</p:panelGrid>
<at:validateBean value="#{testController.controllerBean}"/>
</h:form>
</ui:define>
</ui:composition>
点击“下一步”按钮时,
此处: page2.xhtml 输入文本字段为:
<!DOCTYPE html [<!ENTITY nbsp " ">]>
<ui:composition xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://xmlns.jcp.org/jsf/html" xmlns:f="http://xmlns.jcp.org/jsf/core" xmlns:ui="http://xmlns.jcp.org/jsf/facelets" xmlns:c="http://xmlns.jcp.org/jsp/jstl/core"
xmlns:fn="http://xmlns.jcp.org/jsp/jstl/functions" xmlns:pt="http://xmlns.jcp.org/jsf/passthrough" xmlns:p="http://primefaces.org/ui" xmlns:of="http://omnifaces.org/functions" xmlns:o="http://omnifaces.org/ui" xmlns:jsf="http://xmlns.jcp.org/jsf"
template="/WEB-INF/faces/template/commonInclude.xhtml">
<ui:param name="_pageTitle" value="Second Page"/>
<ui:define name="content">
<h:form id="secondpageform" prependId="false">
<c:set var="testController" value="#{testController}" scope="request"/>
<c:set var="controllerBean" value="#{testController.controllerBean}" scope="request"/>
<p:messages closable="true" escape="false"/>
<h:panelGroup layout="block"><h:outputText value="Second Page"/></h:panelGroup>
<br/>
<br/>
<p:panelGrid>
<p:row>
<p:column>
<p:inputText value="#{controllerBean.newNumber}" id="controllerBean_-newNumber" />
</p:column>
</p:row>
</p:panelGrid>
<br/>
<br/>
<p:panelGrid>
<p:row>
<p:column>
<p:commandButton type="button" value="Next" id="next"/>
</p:column>
</p:row>
</p:panelGrid>
<at:validateBean value="#{testController.controllerBean}"/>
</h:form>
</ui:define>
</ui:composition>
问题:
此问题仅在Mozilla Firefox浏览器中发生。