Prettyfaces always uses POST-REDIRECT-GET pattern to perform the navigation. So your chance is to invoke a managed bean method in your h:commandButton
action method instead of returning the navigation result itself and put your parameter in flash scope:
<h:commandButton value="Ajout"
action="#{home.actionGoToAddStudent}"
rendered="#{home.study_name ne '-----'}" />
And in your managed bean:
public String actionGoToAddStudent(){
FacesContext.getCurrentInstance().getExternalContext().getFlash().put("param1", study_name);
return "pretty:participant"; //or just "/addParticipant.xhtml" and Prettyfaces will translate to pretty url
}
After that, you can retrieve param1
from your destination managed bean. That's for using hidden parameters.
Whenever you want to use standard visible GET parameters, you'll find this post helpful. Using GET parameters involves sending them with the GET request, so your destination page has to catch them with an <f:viewParam>
and can keep them into a destination managed bean property. Here you can refer to my previously answered question:
Source page:
<!--Performs a GET request with study param-->
<h:button value="Basic GET request" outcome="pretty:participant">
<f:param name="study" value="#{home.study}" />
</h:button>
Destination page:
<f:metadata>
<!--Takes the study param and sets it into the destination bean's property-->
<f:viewParam name="study" value="#{destinationBean.study}" />
</f:metadata>
<h:outputFormat value="Print : {0} ">
<f:param value="#{destinationBean.study}" />
</h:outputFormat>