Primefaces对话框框架-不起作用 [英] Primefaces Dialog Framework - Not Working

查看:142
本文介绍了Primefaces对话框框架-不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Primefaces Dialog Framework v 4无法正常工作,我已经用谷歌搜索解决了这个问题,因为我将以下代码添加到faces config中,但都徒劳无功.请在下面找到代码:

Primefaces Dialog Framework v 4 is not working, I have googled to solve the problem as I have added the following code to faces config but all went in vain. Please find the code below:

索引页:

<p:commandButton value="View" icon="ui-icon-extlink" actionListener="#{dialogBean.viewCars}" /> 

Bean代码:

 public void viewCars() {  
    RequestContext.getCurrentInstance().openDialog("viewCars");  
} 

人脸配置:

<application>   <action-listener>org.primefaces.application.DialogActionListener</action-listener>
<navigation-handler>org.primefaces.application.DialogNavigationHandler</navigation-handler>
<view-handler>org.primefaces.application.DialogViewHandler</view-handler></application>

TypeError:this.jq.draggable不是函数 在/faces/javax.faces.resource/primefaces.js?ln=primefaces&v=4.0中

TypeError: this.jq.draggable is not a function in /faces/javax.faces.resource/primefaces.js?ln=primefaces&v=4.0

如何解决该问题?

推荐答案

正如Cagatay Civici所说,您必须将此行添加到页面标题:

As Cagatay Civici said you must add to the header of your page this line:

<h:outputScript name="jquery/jquery-plugins.js" library="primefaces"/>

不用担心-不要将任何文件复制到您的项目中-上面的行就足够了,因为PrimeFaces会自动添加js文件.

Don't worry - do not copy any files to your project - above line is enough because PrimeFaces automatically adds js file.

但是您还必须在faces-config.xml文件中添加几行:

But you must also add few lines to your faces-config.xml file:

<application>
  <action-listener>org.primefaces.application.DialogActionListener</action-listener>
  <navigation-handler>org.primefaces.application.DialogNavigationHandler</navigation-handler>
  <view-handler>org.primefaces.application.DialogViewHandler</view-handler>
</application>

您还可以阅读劳拉·利帕鲁洛(Laura Liparulo)的文章.

You may also read this article of Laura Liparulo.

这篇关于Primefaces对话框框架-不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆