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 ofPF(‘widgetVar’).show()
to keep the window scope clean. It seems not everyone has migrated toPF(‘…’)
in 4.x and upon requests of two PRO users, we have added a context parameter to bring window scope back. Please note thatPF(‘…’)
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/