Committing Controls

From Apache OpenOffice Wiki
< Documentation‎ | DevGuide
Revision as of 12:52, 15 February 2008 by Ccornell (Talk | contribs)

Jump to: navigation, search



The second direction of the data transfer is back from what the user enters into the control. The text entered by a user is immediately forwarded to the value property of the control model. This way, both the control and the control model are always consistent.

Next, the content property is transferred into the data column the control is bound to. As opposed to the first step, this is not done automatically. Instead, this control is committed actively.

Committing is the process of transferring the current value of the control to the database column. The interface used for this is com.sun.star.form.XBoundComponent that provides the method commit. Note that the XBoundComponent is derived from com.sun.star.form.XUpdateBroadcaster. This means that listeners are added to a component to monitor and veto the committing of data.

The following diagram shows what happens when the user decides to save the current record after changing a control:

Control committing data

Note that in the diagram, there is a controller instance involved. In general, this is any instance capable of controlling the user-form interaction. In OpenOffice.org, for every document view and form, there is an instance of the com.sun.star.form.FormController service, together with some not-yet UNO-based code that takes on the role of a controller.

Content on this page is licensed under the Public Documentation License (PDL).
Personal tools