how can I make a page reload (and the model values updated) by checking/unchecking a selectBooleanCheckbox?
@Ellie: I tried both <a4j:ajax event="click" action="doiListView"/> and <f:ajax event="click" action="doiListView"/>, but nothing happens. The (piece of) code is this:
<td style="font-size: 5pt; border: 0; min-width:60px">
<rich:calendar id="creationToDate" value="#{listModel.creationDate.rangeEnd}"
datePattern="yyyy-MM-dd" enableManualInput="true"
rendered="#{listModel.creationDate.range}"
valueChangeListener="#{listController.filterFieldChanged}">
</rich:calendar>
</td>
<td rowspan="2">
<h:selectBooleanCheckbox value="#{listModel.creationDate.range}">
<a4j:ajax event="click" action="doiListView"/>
</h:selectBooleanCheckbox>
</td>
The datepicker should become visible if the checkbox is selected. But with your hint above, nothing happens…
If I add onclick=”window.location.href=window.location.href” in the selectBooleanCheckbox tag, then it works, but as I said I would like to use RF components if possible…
Your question is not very specific. But as far I understand, you basically want to submit the entire form and reload the entire page (why not just the form?).
In that case, you need to set the
executeattribute to@formso that the entire form will be submitted (it namely defaults to@this, the current component) and you also need to set therenderattribute to@allso that the entire view will be re-rendered (or use@forminstead if just re-rendering the form is sufficient).The
event="click"is by the way optional in the above construct. It’s already the default ajax event for a<h:selectBooleanCheckbox>. You can just leave it away:Also, your
actionattribute is not valid. It does not exist. If you actually want to invoke a method during invoke actions phase, then you need thelistenerattribute instead.with
or, optionally, if you need to be able to broadcast events:
The syntax is the same for
<a4j:ajax>. The only difference is that it resolvesexecuteandrendera bit differently and supports more convenient attributes.See also:
<f:ajax>VDL documentation<a4j:ajax>VDL documentation