A widget that serves as a container for other widgets, the top-level widget in
a form description file.
version: $Id: Form.java 475908 2006-11-16 20:15:45Z vgritsenko $
addWidgetEvent(WidgetEvent event) Events produced by child widgets should not be fired immediately, but queued in order to ensure
an overall consistency of the widget tree before being handled.
Events produced by child widgets should not be fired immediately, but queued in order to ensure
an overall consistency of the widget tree before being handled.
Parameters: event - the event to queue
addWidgetUpdate
public boolean addWidgetUpdate(Widget widget)(Code)
Mark a widget as being updated. When it Ajax mode, only updated widgets will be redisplayed
Parameters: widget - the updated widget true if this widget was added to the list (i.e. wasn't alredy marked for update)
endProcessing
public void endProcessing(boolean redisplayForm)(Code)
End the current form processing after the current phase.
Parameters: redisplayForm - indicates if the form should be redisplayed to the user.
Get the widget that triggered the current processing. Note that it can be any widget, and
not necessarily an action or a submit.
the widget that submitted this form.
Initialize the form by recursively initializing all its children. Any events occuring within the
initialization phase are buffered and fired after initialization is complete, so that any action
from a widget on another one occurs after that other widget has been given the opportunity to
initialize itself.
Processes a form submit. If the form is finished, i.e. the form should not be redisplayed to the user,
then this method returns true, otherwise it returns false. To know if the form was sucessfully
validated, use the
Form.isValid() method.
Form processing consists in multiple steps:
all widgets read their value from the request (i.e.
Form.readFromRequest(FormContext) is called recursively on
the whole widget tree)
if there is an action event, call the FormHandler
perform validation.
This processing can be interrupted by the widgets (or their event listeners) by calling
Form.endProcessing(boolean) .
Note that this method is synchronized as a Form is not thread-safe. This should not be a
bottleneck as such concurrent requests can only happen for a single user.