I have a report that needs to be opened in another tab, but only if the validation hasn\'t failed. In my case, the validation fails and the same page opens in another tab wi
Luiggi has answered the POST matter. If the report is however available by a GET request, then there are other ways.
Use window.open() in oncomplete.
...
Or conditionally render a with window.open().
...
window.open('reportURL');
Or use PrimeFaces RequestContext#execute() with window.open().
public void submit() {
// ...
RequestContext.getCurrentInstance().execute("window.open('reportURL');");
}
The first way requires the URL to be already definied before submit, the latter two ways allows you to use a dynamic URL like so window.open('#{bean.reportURL}').