I'm using JSF 2.0 and I have the following on my jsf page
<p:commandLink id="takeLink"
action="#{myQBean.displayApp(app)}" value="Take">
</p:commandLink>
and the method triggered by the backing bean
public String displayApp(App app) {
markAppAsTaken(app);
return "SingleAppView?faces-redirect=true&appRefNo="+app.getNo()+"&verNo="+app.getVersionNo();
}
My problem is that this approach doesn't bound the URL to the link before click, it bounds the #
, and If I would to right click and open in a new tab it will open the same page.
I want the same behavior of <h:link />
tag and <h:outputLink />
to retrieve the whole url SingleAppView?faces-redirect=true&appRefNo=1&verNo=3
instead of #
, and also to invoke a method in the backing bean.
I want a way to invoke the method in the backing bean and retain the full URL at the same time.