Difference between revisions of "Documentation/DevGuide/Forms/Committing Controls"

From Apache OpenOffice Wiki
Jump to: navigation, search
(Initial author Sun Microsystems, Inc.)
 
m (FINAL VERSION FOR L10N)
(3 intermediate revisions by 2 users not shown)
Line 6: Line 6:
 
|NextPage=Documentation/DevGuide/Forms/External Value Suppliers
 
|NextPage=Documentation/DevGuide/Forms/External Value Suppliers
 
}}
 
}}
{{DISPLAYTITLE:Committing Controls}}
+
{{Documentation/DevGuideLanguages|Documentation/DevGuide/Forms/{{SUBPAGENAME}}}}
 +
{{DISPLAYTITLE:Committing Controls}}
 
<!--<idltopic>com.sun.star.form.XBoundComponent</idltopic>-->
 
<!--<idltopic>com.sun.star.form.XBoundComponent</idltopic>-->
 
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.
 
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.
Line 21: Line 22:
  
 
{{PDL1}}
 
{{PDL1}}
[[Category: Forms]]
+
 
 +
[[Category:Documentation/Developer's Guide/Forms]]

Revision as of 13:01, 15 May 2009



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
In other languages