- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
from javascript
我需要从 JavaScript 显示一个 p:confirmDialog
。
我已经尝试过:
<p:confirmDialog id="users" widgetVar="UsersWidget" severity="alert" closable="false">
<h:outputText value="Please specify the UserID of the contractor to whom a mail need to be sent"></h:outputText>
<h:inputText></h:inputText>
<p:commandButton id="OK" value="add"></p:commandButton>
<p:commandButton style="font-size:1.1em;" id="Cancel"
value="cancel" action="#{Bean.Report}" >
</p:commandButton>
</p:confirmDialog>
<f:selectItem itemLabel="Select One" itemValue="" />
<f:selectItems value="#{Bean.usersList}"/>
<f:selectItem itemLabel="Other" itemValue="Other" />
<p:ajax listener="check()" />
我的 JavaScript
<h:head>
<script language="javascript">
function check() {
alert("Entered");
RequestContext.getCurrentInstance().execute("UsersWidget.show()");
alert("Working!!");
}
</script>
</h:head>
我可以看到输入的警报,但我看不到符合对话框和工作警报
最佳答案
您正在混合 Java 和 JavaScript。
在 JavaScript 中,您只需执行以下操作:
<script language="javascript">
function check() {
alert("Entered");
UsersWidget.show();
alert("Working!!");
}
</script>
UsersWidget
对应于您在 p:confirmDialog
的属性 widgetVar
中设置的名称。
如果您想在调用后备 bean 后显示对话框,您可以在 Java 代码(后备 bean)中调用它:
public void myJavaMethod() {
RequestContext.getCurrentInstance().execute("UsersWidget.show()");
}
请求返回后,将立即显示该对话框。
关于javascript - 显示 <p :confirmDialog> from javascript,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21089073/
我以前使用 javascript 确认框,现在想切换到 PrimeFaces . 现在是这样工作的: 我如何传递 deleteID参数以防我使用 confirmDialog
在我的 Web 应用程序中,我有一个空闲监视器,如果用户空闲 5 分钟就会触发该监视器。它将打开一个确认对话框,等待 2 分钟;之后它将重定向到登录页面。 要求:我想显示一个倒数计时器,其中包含用户将
我的导航栏工作得很好并且完全负责,但是当我在后台打开确认对话框时,我的导航栏宽度变为 800px 即使屏幕有 1480px 使一个空右侧的空间,就像您在屏幕上看到的那样。 我真的不知道如何修复它,这是
我现在在 tabView 中使用 confirmDialog 时遇到问题。这是我的确认对话框 在第一个 tabView 中,我有一个确认按钮
from javascript
我需要从 JavaScript 显示一个 p:confirmDialog。 我已经尝试过: 我的 JavaScript fun
确认对话框显示两次是什么情况?或者其他方面,确认对话框显示两次是什么原因? 我有一个简单的对话框模板 private showConfirmDialog() {
确认对话框显示两次是什么情况?或者其他方面,确认对话框显示两次是什么原因? 我有一个简单的对话框模板 private showConfirmDialog() {
如何禁用 dijit/ConfirmDialog 上的确定按钮? var lasloLoginFormDialog = new ConfirmDialog({ title: "Login",
我在带有 MyFaces 2.0.2 的 WebSphere Application Server 8 上使用 PrimeFaces 3.2。 我有一个在 Firefox 中运行良好的 confirm
当 中的一行被右键单击, 出现一个删除选项。单击此选项时, 出现两个按钮 Yes和 No - 关于删除当前行的构象警告如下。 有没有办法设置message此
我有 RequestScoped bean,因为我将用户从带有记录的数据表重定向到编辑页面。在此数据表中,我有删除按钮: 这是对话框:
我有 RequestScoped bean,因为我将用户从带有记录的数据表重定向到编辑页面。在此数据表中,我有删除按钮: 这是对话框:
我以非常默认的方式使用 PrimeFaces dataTable 和 rowEditor: ... 我希望在单击 rowEditor 的“检查”按钮时显示一个确认对话框。 我知道
我试图在单击 PrimeFace CommandLink 时打开 PrimeFace 确认对话框。但是,当单击链接时,对话框会打开一会儿,但立即消失,我猜页面正在提交。这是代码:
我试图将 PrimeNg TabView 组件与 confirmDialog 一起使用但没有成功,这是我的代码: ... onTabChange(event){ this.confirma
我想通过支持调用confirmDialog。此代码完美运行,但我如何通过支持设置消息并设置 confirmDialog 的 actionlistener?有两个条件,而: 用户在checkbox上勾选
我有一个 comandButton,它调用一个必须消除用户的 confirmDialog,但它从不调用它的 actionListener 中的方法。 这是代码:
我有一个使用 PrimeFaces 3.0.1 在模态对话框上显示的模态 ConfirmDialog。如果 ConfirmDialog 被打开,整个页面都会被锁定,包括 ConfirmDialog 本
我有一个 Primefaces 数据表,当用户单击一行时,我会在表单中显示要编辑的数据。 如果用户更改表单中的数据并单击任何其他行,即如果有脏数据,我需要弹出一个 confirmDialog 以显示用
我正在尝试将 PrimeNg TabView 组件与 confirmDialog 一起使用,但未成功 我能够显示此确认对话框,但它在用户切换到错误的目标选项卡面板后出现。 ... handleChan
我是一名优秀的程序员,十分优秀!