jsf 2 - JSF action method with variable parameter -


how call method variable parameters in jsf?

i tried this:

<h:commandbutton value="send" action="#{mybean.checkpin(someotherbean.pin)}" /> 

however, doesn't work.

if using el 2.2+, it's possible.

if using older version ot el, can use following:

<h:commandbutton value="send" action="#{mybean.checkpin}" />    <f:param name="parameter" value="123" /> </h:commandbutton> 

in managed bean can retrieve like:

public void checkpin() {    ...    map<string, string> parametermap = (map<string, string>) externalcontext.getrequestparametermap();    string param = parametermap.get("parameter");    ... } 

Comments

Popular posts from this blog

c# - Operator '==' incompatible with operand types 'Guid' and 'Guid' using DynamicExpression.ParseLambda<T, bool> -