次のコードは、primefaces 3.0 で機能し、3.5 では機能しません。
エラー: dialog () は javascript に存在しません もしそうなら、代替手段は何ですか?
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>