jsf 2 - How can I retain the full URL on a right click and invoke an action at the same time (JSF) -


i'm using jsf 2.0 , have following on jsf page

<p:commandlink id="takelink" action="#{myqbean.displayapp(app)}" value="take"> </p:commandlink> 

and method triggered backing bean

public string displayapp(app app) {     markappastaken(app);     return "singleappview?faces-redirect=true&apprefno="+app.getno()+"&verno="+app.getversionno();     } 

my problem approach doesn't bound url link before click, bounds #, , if right click , open in new tab open same page.

i want same behavior of <h:link /> tag , <h:outputlink /> retrieve whole url singleappview?faces-redirect=true&apprefno=1&verno=3 instead of #, , invoke method in backing bean.

i want way invoke method in backing bean , retain full url @ same time.

you can use in lines of:

<h:link value="take" outcome="#{myqbean.displayapp}" >     <f:param name="appno" value="#{app.no}" />     <f:param name="verno" value="#{app.versionno}" /> </h:link> 

and...

public string displayapp() {     string appno = facescontext.getexternalcontext().getrequestparametermap().get("appno");     app app = service.findapp(appno);     markappastaken(app);     return "singleappview?faces-redirect=true&includeviewparams=true"; } 

Comments

Popular posts from this blog

Android layout hidden on keyboard show -

google app engine - 403 Forbidden POST - Flask WTForms -

c - Why would PK11_GenerateRandom() return an error -8023? -