I'm trying to open a new window from dataTable using primefaces. I've tried differents options:
h:commandLink
<h:form id="form" target="_blank"> <p:dataTable id="Table" var="var_row" value="#{bean.table}" sortBy="tableId" > <p:column> <h:commandLink action="#{bean.goToPage}" value="Open Page" onblur="this.form.target='_self'"> <f:setPropertyActionListener value="#{var_row}" target="#{bean.rowSelected}" /> </h:commandLink> </p:column> </p:dataTable> </h:form>
2.p:commandLInk
<h:form id="form" target="_blank">
<p:dataTable id="Table" var="var_row" value="#{bean.table}" sortBy="tableId" >
<p:column>
<p:commandLink action="#{bean.goToPage}" value="Open Page"
onblur="this.form.target='_self'"
process="@this" ajax="false" target="_blank">
<f:setPropertyActionListener value="#{var_row}" target="#{bean.rowSelected}" />
</p:commandLink>
</p:column>
</p:dataTable>
</h:form>
It works, but not correctly. I mean, I get the new page open, but the original page becomes useless, all methods in this pages are not invoked when you clicked on them.
Has anyone experimented this before? Any idea to solve this?