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