Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cannot call widgetVar directly in PrimeFaces 5

Tags:

primefaces

I want to switch from PF4.0 to PF5.0, in my console I see a lot of Reference error, because the widgetVars of my elements are no longer exists. However I can call for example the confirmDialogVar widget as PF('confirmDialogVar').show() but not with confirmDialogVar.show() as before.

Is it possible to bring back the 'old' functionality?

Thanks in advance!

like image 286
kennyevo Avatar asked May 07 '14 09:05

kennyevo


2 Answers

The old method was already deprecated in 4.0 and they removed it in 5.0.

Now I have a lot to refactor :D

like image 108
kennyevo Avatar answered Nov 18 '22 08:11

kennyevo


For those who have come across this, there is another global solution if you do not want to refactor everything. Taken from the User Guide for Primefaces 5.1, you can add a context parameter which will allow the legacy method of referencing widgets to work:

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

Doug.

like image 35
Doug Avatar answered Nov 18 '22 08:11

Doug