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?
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?
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.
© 2022 - 2024 — McMap. All rights reserved.