jsf - Passing a parameter with h:commandButton -


I have a4j: commandButton which wants to redirect me to a suitable "edit" page based on an ID, which I want to pass as a parameter, something like this:

  & lt; H: Command Button Button = // / details.jsf? Face-redirect = true "value =" details ">   / Code>  

The problem is, it does not work, I tried to change the F: attribute with "f: ultimate name =" id "value =" # {bean.id} "" , But this also failed. The only work I have to work is the link:

  
  • outputLink value = "/ details.jsf" & gt; link & lt; f: Ultimate name = "id" value = "# {bean.id}" />
  • But I'm not really happy with a link If so, what command button Is there a way to do this work?

    Oh, and I also have a bean that is supposed to get "id" after redirection:

      @ PostConstruct public zero init () {id = resolve ("id");}  

    Take a look at the communications in JSF

    f: Ultimate with only h: commandLink and h: outputLink Works.

    You can use an input hiding:

       & Lt; Input type = "hidden" name = "id" value = "# {bean.id}" /> & lt; / H: form & gt;  

    And then in your face-configurations, I think the request is Scod. If you use annotations for JSF 2, translate it into correct annotation.

      & lt; Managed-Bean & gt; & Lt; Managed-name names & gt; Beans & lt; / Managed-name names & gt; & Lt; Successful bean category & gt; Mypackage.bene & lt; / Successful bean category & gt; & Lt; Realm of managed-beams & gt; Request & lt; / Managed-beans scope & gt; & Lt; Managed-asset & gt; & Lt; Asset-name & gt; Id & lt; / Property-name & gt; & Lt; Price & gt; # {Param.id} & lt; / Pricing & gt; & Lt; / Managed-properties & gt; & Lt; / Successful bean>  

    You need to have gates and setters for that field in the beacon bean.

    Or try to "paint" through a CSS as a button.


    Comments