我想将jquery datapicker用于文本框。在页面中显示它。但我在primefaces对话框中使用同样的东西,但数据贴纸没有显示。
这是我的xhtml代码:
<!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: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" template="../templates/ui.xhtml">
<h:head>
<title>Page title</title>
<link rel="stylesheet" type="text/css" href="../../css/JqueryUICalender/jquery.datepick.css"/>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
<script type="text/javascript" src="../../js/JqueryUICalender/jquery.plugin.js"></script>
<script type="text/javascript" src="../../js/JqueryUICalender/jquery.datepick.js"></script>
<script type="text/javascript" language="javascript">
jq=jQuery.noConflict(true);
jq(document).ready(function()
{
jq("[id='form1id:dumid']").datepick({
multiSelect: 999, monthsToShow: 1,
showTrigger: '#calImg'});
jq("[id='form2id:calenderinputid']").datepick({
multiSelect: 999, monthsToShow: 1,
showTrigger: '#calImg'});
});
</script>
</h:head>
<f:view>
<h:body >
<p:layout fullPage="true">
<p:layoutUnit position="center" style="border:none">
<h:form id="form1id">
<table width="90%">
<tr>
<td>
<p:inputText id="dumid"></p:inputText>
</td>
</tr>
</table>
<p:commandButton value="Open Dialog" onClick="PF('dialogwidgetwar').show()"/>
</h:form>
<p:dialog header="Header" id="dialogid" widgetVar="dialogwidgetwar" dynamic="true" closable="false"
resizable="false" draggable="false" width="400" appendTo="@(body)" modal="true" position="450,80">
<h:form id ="form2id">
<table width="90%">
<tr>
<td>
<p:inputText id="calenderinputid" value=""/>
</td>
</tr>
</table>
</h:form>
</p:dialog>
</p:layoutUnit>
</p:layout>
</h:body>
</f:view>
</html>
当我点击dumid文本框时,正在显示数据贴纸。但是在弹出窗口中单击calendarinputid文本框时,没有显示datepicker。