jsf - PrimeFaces 改变了我们引用 widget 变量的方式

标签 jsf primefaces

PrimeFaces 改变了我们引用 widget 变量的方式。

  • PrimeFaces 3.2 widgetVar.show()
  • PrimeFaces 5.x PF('widgetVar').show()

我正在将一个项目从 PrimeFaces 3 迁移到 PrimeFaces 5.2。 是否有任何快速修复此更改的方法,而不是在所有 XHTML 页面中更改它?

最佳答案

Legacy Widget Namespace

In 4.0, widgetVar.method() usage to access the client side api of a component has been deprecated in favor of PF(‘widgetVar’).show() to keep the window scope clean. It seems not everyone has migrated to PF(‘…’) in 4.x and upon requests of two PRO users, we have added a context parameter to bring window scope back. Please note that PF(‘…’) is always on, following configuration also enables access from window scope as before (widgetVar.method()).

<context-param>
    <param-name>primefaces.LEGACY_WIDGET_NAMESPACE</param-name>
    <param-value>true</param-value>
</context-param>

来源:Primefaces blog , Github

关于jsf - PrimeFaces 改变了我们引用 widget 变量的方式,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36149072/

相关文章:

validation - 关于在一个字段上使用 FacesValidator(JSF 验证)和 Bean 验证的问题

jsf-2 - 使用执行器服务时如何使用jsf添加消息?

java - actionListener 不起作用,但该方法起作用

jsf-2 - Primefaces 数据表列选择

java - 真的不能在 RichFaces 中使用任何纯 HTML 吗?为什么?

jsf - ExternalContext#redirect() 不会重定向到父目录

jsf - EL 空运算符在 JSF 中如何工作?

JSF 2.2小时:inputFile not working with pretty faces

在 Wildfly 上上传 Primefaces 文件

jsf - 后端处理的进度条主要内容