Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Primefaces RequestContext under 7.0

Tags:

primefaces

My pre-7.0 Primefaces application has this code:

RequestContext.getCurrentInstance().execute("window.open('myUrl');");

I understand that RequestContext is no longer available in 7.0. What is the equivalent to perform the same action?

like image 600
Tom T Avatar asked Mar 21 '19 16:03

Tom T


1 Answers

Beside other changes the RequestContext class has been deprecated in version 6.2 and removed in version 7.0 of Primefaces. It is replaced by calling PrimeFaces.current(). In your case, the code should be changed to:

PrimeFaces.current().executeScript("window.open('myUrl');");

Please keep looking into the migration guide (already linked by @Melloware in comment) when upgrading your Primefaces dependency.

like image 95
Selaron Avatar answered Nov 10 '22 02:11

Selaron