Is it possible to submit a JSF form with the help of a checkbox?
I have multiple checkboxes and when I click on one of them, then it should actually submit the form and go to the next page. The checkbox value should be bound to a backing bean.
With JSF 1.x you can do:
<h:selectBooleanCheckbox value="#{aBean.aFiled}" onclick="submit()" />
If you use JSF 2.x, then you can use ajax:
<h:selectBooleanCheckbox value="#{aBean.aFiled}">
<f:ajax event="click" execute="@form" />
</h:selectBooleanCheckbox>
For JSF and ajax take a look at: Learning JSF2: Ajax in JSF – using f:ajax tag
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