I would like to make a button which navigates to a different URL and pass some request parameters through in the URL. The outputLink works but I would like a button, the commandButton looks good but I can pass parameters.
Is there a solution?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The
h:commandButtondoesn’t fire aGETrequest, but aPOSTrequest, so you can’t use it. If you’re already on JSF 2.0 and the target page is in the same context, then you can use theh:buttonfor this:(no
h:formis required here as inh:outputLink). This will create a button which goes tootherViewId.jsf?param1=value1¶m2=value2.But if you’re not on JSF 2.0 yet, then your best is just to grab CSS to style the link like a button.
with something like