You are reading O'Reilly XForms Essentials by Micah Dubinko. (What is this?) - Buy XForms Essentials Online
XForms keeps track of computational dependencies, like a spreadsheet, so that any chained calculations properly resolve themselves in the face of changes. This action explicitly invokes a rebuilding of the dependencies, and is almost never needed.
These four actions trigger the processing involved with revalidation, recalculation, refresh, and rebuilding dependencies, respectively. Under normal conditions, all of these activities take place automatically, and form authors don't even need to consider these events or actions.
The primary exception, however, is on limited platforms where any of these activities might be expensive, in terms of processing or perceived user delay. When that's the case, it's not desirable for these events to happen automatically. Instead, users will want to have greater control over exactly when such things happen. This is similar to the concept of spreadsheets that have an option to turn off automatic recalculation.
To do this in XForms is a two-step process. First, an observer needs to be set up to cancel all automatically generated events for the expensive process (recalculation in this example). That step, by itself, will result in the recalculation never happening, which doesn't work so well. So the second step is to provide an option for the user to manually fire off a recalculate. This example shows both aspects:
<model ev:event="xforms-recalculate" ev:defaultAction="cancel">
...
<trigger>
<label>Recalculate now</label>
<recalculate ev:event="DOMActivate"/>
</trigger>
Note that this works because the recalculate action directly invokes the processing, without the intervening event flow (which would get cancelled by the observer on model anyway).