以下在 primefaces 3.0 中工作的代码在 3.5 中不起作用。
错误: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>