Example usage of CommandLink and Javascript in Primefaces

To open a url in a new tab or window using Javascript:
Whether it is a new tab or a new window, also depends on browser's setting.

To do some back end job first and then redirect to a new tab or window, for example, to save user's job and then preview in a new tab/window, we can do the following:
<p:commandLink value="Preview" 
oncomplete="window.open('your-url','_blank');" />


Popular posts from this blog