我使用了 Primefaces 日历组件,它在表单中不起作用。当我单击文本字段时,弹出窗口一显示就迅速消失。外部h:form
弹出窗口正在显示,但整体组件仍然无法像月/年那样工作,不能选择。不建议为什么?
以下是我的advSearch.xhtml
小脸,其模板是Master.xhtml
<!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: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"
template="/MasterPage/Master.xhtml">
<ui:define name="Search">
<h:form id="advSearch" onmousemove="removeExtra()">
<p:layout style="width:1218px;height:558px;" id="layout">
<p:layoutUnit position="center" styleClass="resultDiv">
<div class="advDiv">
<div class="advHeader">Find documents That Have...</div>
<div class="advBody">
<table>
<tr>
<td><h:outputText styleClass="advLabel" value="Subject"></h:outputText></td>
<td><h:inputText
value="#{advanceSearchController.subject}"
styleClass="txtfield"
onkeypress="if (event.keyCode == 13) { document.getElementById('advSearch:advButton').click(); return false; }"></h:inputText>
</td>
</tr>
<tr>
<td><h:outputText styleClass="advLabel" value="Signed By"></h:outputText></td>
<td><h:inputText
value="#{advanceSearchController.signBy}"
styleClass="txtfield"
onkeypress="if (event.keyCode == 13) { document.getElementById('advSearch:advButton').click(); return false; }"></h:inputText></td>
</tr>
<tr>
<td><h:outputText styleClass="advLabel"
value="Archived From"></h:outputText></td>
<td><p:calendar styleClass="txtfield" mode="popup"
navigator="true" yearRange="1900:2015" pattern="MM/dd/yyyy"
converter="CalendarDateStringConverter"
value="#{advanceSearchController.fromdate}" /></td>
</tr>
<tr>
<td><h:outputText styleClass="advLabel" value="To"></h:outputText></td>
<td><p:calendar styleClass="txtfield" mode="popup"
navigator="true" yearRange="1900:2015" pattern="MM/dd/yyyy"
converter="CalendarDateStringConverter"
value="#{advanceSearchController.todate}" /></td>
</tr>
</table>
<h:commandButton id="advButton" styleClass="btn"
value="Advanced Search"
action="#{advanceSearchController.advanceSearch}"
style="background-color:#FEAA41;background-image:none;color:white;font-weight:bold;"></h:commandButton>
</div>
</div>
</p:layoutUnit>
</p:layout>
</div>
</h:form>
</ui:define>
任何帮助将不胜感激。