:: com :: sun :: star :: form ::

service FormController
Description
specifies a component controlling the interaction between the user and form functionality.

As soon as a form (containing controls) is to be presented to the user, there is a need for an instance controlling the user interaction.
Such a FormController is responsible for dialog processing, like controlling the tab order and the grouping of controls.

As a form may contain one or many subforms, a FormController may contain one or more other FormController s, so the form model structure or hierarchy is reflected in the structure of FormController s.

Responsibilities

A FormController is responsible for a ::com::sun::star::awt::UnoControlContainer , and all controls therein.

Furthermore, a form controller is responsible for preventing invalid user input. That is, if the form contains controls bound to a database, or to an external validator, then the form controller will check their current value when the current record is to be saved to the database.

First, it will check whether any controls with an external validator exist. If so, those validators will be asked to validate the current control content. If this fails, the message provided by the validator is displayed to the user, the control is focused, and the update of the record is vetoed.

Second, the controls are examined for NULL values. If a control is bound to a database field which is declared to be NOT NULL , no auto-increment field, but still NULL , then an error message is shown to the user saying that input is required, the respective control is focused, and the update of the record is vetoed.

Note that you can precent the second check - for database fields containing NULL values - on a per-form and a per-database basis.
For the former, you need to add a boolean property FormsCheckRequiredFields to the form (aka the FormController 's model), using its ::com::sun::star::beans::XPropertyContainer::addProperty method, with a value of false .
For the latter, you need to set the respective property of the data source's Settings (also named FormsCheckRequiredFields ) to false .

See also
::com::sun::star::form::component, ::com::sun::star::awt::XTabController, ::com::sun::star::form::binding::BindableControlModel, ::com::sun::star::sdb::DataSource::Settings

Included Services
FormControllerDispatcher
Usage Restrictions
optional
Description
allows delegating form controller functionality to the component

If a control which the controller is responsible for supports the ::com::sun::star::frame::XDispatchProviderInterception interface, the controller registers a dispatch interceptor. Then, the control can try to delegate part of its functionality to the controller by querying the dispatch interceptor for it.

Exported Interfaces
XFormController
Description
is used for notifying the (de)activation of the controller.
::com::sun::star::awt::XTabController
Description
is used for tab controlling and grouping of the controls.
::com::sun::star::container::XChild
Description
A FormController may have a parent controller, such as when the related form is a subform.
::com::sun::star::lang::XComponent
Description
A FormController must be disposable.
::com::sun::star::container::XEnumerationAccess
Description
A FormController must provide access to its sub controllers.
::com::sun::star::util::XModifyBroadcaster
Description
A FormController must communicate if any of its children (means sub controllers) or contained controls have been modified.
XConfirmDeleteBroadcaster
Description
used to notify deletions of data in the form before they happen.

A form controller listens for deletion events at the form it is responsible for.
If and only if no XConfirmDeleteListener is registered at the controller, it uses an own dialog to ask the user for confirmation.

You may use this interface to integrate your own confirmation dialogs.

::com::sun::star::sdb::XSQLErrorBroadcaster
Description
used to notify errors which happen in the form the controller is responsible for.

A form controller listens for error events at the form it is responsible for.
If and only if no ::com::sun::star::sdb::XSQLErrorListener is registered at the controller, it uses an own dialog to notify the user of the error.

::com::sun::star::sdb::XRowSetApproveBroadcaster
Description
is used for multiplexing row set events happening on the form which the controller is responsible for.
XDatabaseParameterBroadcaster
Description
is used broadcasting parameter events in the form.

A form controller listens for parameter events at the form it is responsible for.
If and only if no XDatabaseParameterListener is registered at the controller, it uses an own dialog to ask the user for parameter values.

Properties' Summary
::com::sun::star::form::runtime::XFormOperations
FormOperations
[ OPTIONAL ]
denotes the instance which is used to implement operations on the form which the controller works for.  
Properties' Details
FormOperations
::com::sun::star::form::runtime::XFormOperations FormOperations;
Usage Restrictions
optional
Description
denotes the instance which is used to implement operations on the form which the controller works for.

This instance can be used, for instance, to determine the current state of certain form features.


 
Top of Page