7.0下的Primefaces RequestContext
Primefaces RequestContext under 7.0
我的 7.0 之前的 Primefaces 应用程序有这个代码:
RequestContext.getCurrentInstance().execute("window.open('myUrl');");
我了解到 RequestContext 在 7.0 中不再可用。执行相同操作的等效项是什么?
除了其他更改外,RequestContext
class 已在 6.2 版中弃用并在 Primefaces 7.0 版中删除。它被调用 PrimeFaces.current()
取代。在您的情况下,代码应更改为:
PrimeFaces.current().executeScript("window.open('myUrl');");
升级您的 Primefaces 依赖项时,请继续查看 migration guide(@Melloware 已在评论中链接)。
我的 7.0 之前的 Primefaces 应用程序有这个代码:
RequestContext.getCurrentInstance().execute("window.open('myUrl');");
我了解到 RequestContext 在 7.0 中不再可用。执行相同操作的等效项是什么?
除了其他更改外,RequestContext
class 已在 6.2 版中弃用并在 Primefaces 7.0 版中删除。它被调用 PrimeFaces.current()
取代。在您的情况下,代码应更改为:
PrimeFaces.current().executeScript("window.open('myUrl');");
升级您的 Primefaces 依赖项时,请继续查看 migration guide(@Melloware 已在评论中链接)。