Is it possible to execute two methods in action of <h:commandButton>
?
For example,
<h:commandButton action="#{bean.methodOne();bean.methodTwo();}" />
You can use f:actionListener
like this.
<h:commandButton action="#{bean.methodOne()}">
<f:actionListener binding="#{bean.methodTwo()}" />
</h:commandButton>
You can add as many f:actionListener
elements as you need.
Add a methodThree in your bean :
public Object methodThree() {
methodOne();
methodTwo();
return someThing;
}
And call this method from the JSF page.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With