Jigar Naik
Jigar Naik

Reputation: 1994

PrimeFaces has changed the way we refer the widget variable

PrimeFaces has changed the way we refer the widget variable.

I am migrating one project from PrimeFaces 3 to PrimeFaces 5.2. Is there any quick fix for this change instead of changing it in all the XHTML pages?

Upvotes: 2

Views: 761

Answers (1)

anotherUser
anotherUser

Reputation: 561

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>

Source: Primefaces blog, Github

Upvotes: 4

Related Questions