本文介绍了在使用ajax侦听器时,“原型”对话框框架不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 29岁程序员,3月因学历无情被辞! 我正在使用Primefaces 4对话框框架打开对话框, public void openDialog(String viewName){ RequestContext.getCurrentInstance()。openDialog(viewName); } 这样做: < p:commandButton value =点击action =#{impaktDialogBean.openDialog('/ popup / test2')}/> 这不是: < p:commandButton value =点击> < p:ajax event =clicklistener =#{impaktDialogBean.openDialog('/ popup / test2')}>< / p:ajax> < / p:commandButton> 所以,Primefaces对话框框架只适用于action& actionListener 我使用的是: Tomcat 7 JSF 2.2.6 Mojarra 解决方案我知道问题很久以前,但未来的时间... 一个< p:remoteCommand> ? < p:remoteCommand name =remoteCmdupdate =anythingactionListener =#{impaktDialogBean.openDialog('/ popup / test2')}/> < p:commandButton value =点击update =任何东西onclick =remoteCmd()> 实现对您的bean的JavaScript调用的不同方法。 I'm trying to open dialog using Primefaces 4 dialog framework,public void openDialog(String viewName) { RequestContext.getCurrentInstance().openDialog(viewName);}This works:<p:commandButton value="Click" action="#{impaktDialogBean.openDialog('/popup/test2')}"/>This doesn't:<p:commandButton value="Click"> <p:ajax event="click" listener="#{impaktDialogBean.openDialog('/popup/test2')}" ></p:ajax></p:commandButton>So, Primefaces dialog framework only works with action & actionListener?????I'm using:Primefaces 4Tomcat 7JSF 2.2.6 MojarraThanks. 解决方案 I know the question was asked long time ago but for future times...What about a <p:remoteCommand> ?<p:remoteCommand name="remoteCmd" update="anything" actionListener="#{impaktDialogBean.openDialog('/popup/test2')}" /><p:commandButton value="Click" update="anything" onclick="remoteCmd()" >Different approach to achieve a javascript call to your bean. 这篇关于在使用ajax侦听器时,“原型”对话框框架不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云! 09-06 04:20