This example demonstrates how to use
ExecutableVisitCallback - PrimeFaces Extensions'
implementation of the JSF API's interface
VisitCallback.
ExecutableVisitCallback uses any class which implements the interface
VisitTaskExecutor
(this interface is defined in the PrimeFaces Extensions). This approach allows to visit
all controls within
pe:dynaForm and to execute any task on them. By this way,
we can implement inter-control (inter-cell) communication within
pe:dynaForm.
In this example, we will implement the interface
VisitTaskExecutor by the class
ClearInputsExecutor which clears all inputs / selects related to one row in
pe:dynaForm.
The
ClearInputsExecutor is instantiated and and set into the
ExecutableVisitCallback.
That happens in the
ClearDynaFormController (see the action method
clearInputs).
This example also demonstrates how to remove rows at runtime. Rows can be removed by the following methods in the
DynaFormModel:
- removeRegularRow(DynaFormRow row)
- removeRegularRow(int index)
- removeExtendedRow(DynaFormRow row)
- removeExtendedRow(int index)
You see here an imaginary filter mask with three rows and four input / select components in each row.
Click on "Clear inputs" and "Remove" links to see this example in action!