【问题标题】:my p : dialog doesn´t work我的 p:对话框不起作用
【发布时间】:2014-12-15 19:30:01
【问题描述】:

我在我的网络项目中使用 JSF2.0 和 primefaces 3.4 简单地说....当我从 show-case 复制 p:dialog 的代码时 我的项目的primefaces,它不起作用,对话框窗口没有出现 (我放的第一个对话框是我页面中想要的真正的对话框......但实际上问题是......) 似乎我的项目中的某些东西没有以正确的方式工作......我只是将代码从 prime-faces show-case 复制到我的页面,但在我的页面中显示 p:dialogs 的 commandButtons 没有工作,p:对话框没有显示。这是我测试的网页,不适合我:

<!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:p="http://primefaces.org/ui" xmlns:ui="http://java.sun.com/jsf/facelets"> <ui:composition template="../template/template.xhtml"> <ui:define name="main"> <h:form id="form">
<h:panelGrid columns="1" cellpadding="5">
<p:commandButton id="basic" value="Basic" onclick="dlg1.show();" type="button" />
<p:commandButton id="modalDialogButton" value="Modal" onclick="dlg2.show();" type="button"/>
<p:commandButton id="effectsDialogButton" value="Effects" onclick="dlg3.show();" type="button" />
</h:panelGrid>
<p:dialog id="basicDialog" header="Basic Dialog" widgetVar="dlg1">
<h:outputText value="Resistance to PrimeFaces is futile!" />
</p:dialog>
<p:dialog id="modalDialog" header="Modal Dialog" widgetVar="dlg2" modal="true" height="100">
<h:outputText value="This is a Modal Dialog." />
</p:dialog>
<p:dialog header="Effects" widgetVar="dlg3" showEffect="explode" hideEffect="bounce" height="100">
<h:outputText value="This dialog has nice effects." />
</p:dialog>
</h:form>
</ui:define> </ui:composition> </html>

【问题讨论】:

  • 请包括 what 不起作用。目前还不清楚您的问题是什么。
  • 问题是对话窗口不显示

标签: primefaces


【解决方案1】:

显示对话框的代码在哪里?类似于

<p:commandButton id="button" value="Open Dialog" oncomplete="PF('dialog').show();"/>

【讨论】:

  • 我已经测试过 PF('dlg3').show() 了......它对我不起作用......我真的无法理解我的项目发生了什么......跨度>
猜你喜欢
  • 2014-01-24
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2012-07-03
  • 1970-01-01
  • 1970-01-01
  • 2013-09-10
  • 1970-01-01
相关资源
最近更新 更多