0
以下在primefaces 3.0中工作的代码在3.5中不起作用。Primefaces 3.0到3.5对话框不起作用
错误:dialog()不存在于javascript我的查询是对话框已从dialog.js中删除?如果是的话,那么什么是替代?
function OpenDialog(currentDialog, commandSource) {
$(currentDialog).dialog('open');
var myDialogX = jQuery(commandSource).offset().left + 10;
var myDialogY = (jQuery(commandSource).offset().top - jQuery(document).scrollTop()) + 30;
//jQuery(currentDialog).dialog('option', 'position', [ myDialogX, myDialogY ]);
}
<p:commandLink id="treedialog-copy"
title="title" value="Copy tree"
oncomplete="OpenDialog('#copyTree','#treedialog-copy')" />
<p:outputPanel id="TreePanel">
<p:dialog id="copyTree" header="Tree Dialog"
styleClass="dlgAssignTree" modal="false" width="600" height="250" widgetVar="copyTrees">
<h:form id="copyTreeForm">
<p:outputPanel id="TreePanel">
<p:tree id="component2"
value="#{bean.provideTreeRootNode}" var="_node"
dynamic="true" cache="false" selectionMode="multiple"
selection="#{bean.selectedCopyNodes}">
<p:ajax event="select"
listener="#{bean.onNodeSelectCopy}" />
<p:ajax event="unselect"
listener="#{processBean.onNodeUnSelectCopy}" />
<p:treeNode>
<h:outputText value="#{_node.name}" />
</p:treeNode>
</p:tree>
</p:outputPanel>
</h:form>
</p:dialog>
</p:outputPanel>
通过查看页面的源代码,检查生成的''和'
'组件的HTML标识符,我敢打赌它们不是'copyTree'和' treedialog-copy'。使用Firebug或Chrome控制台等JavaScript控制台是明智的做法。另外,请确保你的''在''之外,它包含你的'
' – 2013-02-11 04:37:31