Type: info
Title: +css.form.runtime.(X)FormOperations and friends
Posted by: [EMAIL PROTECTED]
Affected: [EMAIL PROTECTED],-
Effective from: CWS dba22a
*Summary*
--------
+ module css.form.runtime
+ css.form.runtime.XFormOperations
+ css.form.runtime.FormOperations
+ css.form.runtime.FormFeature
+ css.form.runtime.FeatureState
+ css.form.runtime.XFeatureInvalidation
*Description*
-------------
XFormOperations (in the newly introduced namespace
com.sun.star.form.runtime) allows for operations on a user interface
form, by saving its clients from various tedious and error-prone
operations.
It is indended to be used by people who want to script an alive
(loaded) form in a document, or who created their own form, with own
form controlling mechanisms, such as for instance the built-in
Bibliography component.
Citing from the interface documentation:
<p>As an example, imagine you have a database form, displayed in some
user interface, which you want to move to the next record.<br/>
It is as easy as calling <member
scope="com:::sun::star::sdbc">XResultSet::next</member>
on this form, right? Wrong. First, you need to care for saving the current
record, so the user doesn't lose her input. So you need to call
<member
scope="com::sun::star::sdbc">XResultSetUpdate::updateRow</member> or
<member
scope="com::sun::star::sdbc">XResultSetUpdate::insertRow</member>,
depending on the form's <member
scope="com::sun::star::sdb">RowSet::IsNew</member> property.<br/>
But then you're done, right? Wrong, again.<br/>
When the user just entered some data into one of the form fields, but
did not yet leave this field, then the data is not yet committed to
the form, not to talk
about being committed to the underlying database. So, before
everything else, you would nee to obtain the active control of the
form, and commit it.<br/>
<em>Now</em> you're done ...</p>
<p>As another example, consider that you want to delete the current
record from the form. You have to take into account any <type
scope="com::sun::star::form">XConfirmDeleteListener</type>s
registered at the <type
scope="com::sun::star::form">FormController</type> or the <type
scope="com::sun::star::form::component">DataForm</type>.</p>
<p>If you agree that this is ugly to do and maintain, then
<code>XFormOperations</code> is for you. It provides a
<member>execute</member> method, which will do all of the above
for you; plus some similar convenient wrappers for similar
functionality.</p>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]