Envoyer paramètre commandButton
Bonjour,
Mon Bean est en RequestScope et j'aimerai passer un paramètre à mon bean lorsque je clique sur mon bouton.
Je me mélange un peu avec : <input type="hidden", binding, <f:param, actionListener...
J'ai tenté ça mais ça ne marche pas. En fait je ne vois pas mon print:
model:
Code:
1 2
| <input type="hidden" name="id" value="#{al.id}" />
<h:commandButton value="OK" action="#{MyManagedBean.doChange}"/> |
controller:
Code:
1 2 3
| public String doChange() {
System.out.println("doChange");
Long selectedId = Long.parseLong(FacesContext.getCurrentInstance().getExternalContext().getRequestParameterMap().get("id").toString()); |
merci d'avance pour votre aide