我的 7.0 之前的 Primefaces 应用程序具有以下代码:
RequestContext.getCurrentInstance().execute("window.open('myUrl');");
我了解 RequestContext 在 7.0 中不再可用。执行相同 Action 的等价物是什么?
最佳答案
除了其他更改之外,RequestContext
class 已在 6.2 版中被弃用,并在 Primefaces 的 7.0 版中被删除。替换为调用 PrimeFaces.current()
.在您的情况下,代码应更改为:
PrimeFaces.current().executeScript("window.open('myUrl');");
请继续关注 migration guide (已由@Melloware 在评论中链接)升级您的 Primefaces 依赖项时。
关于Primefaces RequestContext 7.0 下,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55285566/