Difference between revisions of "Documentation/DevGuide/Forms/Loadable Forms"

From Apache OpenOffice Wiki
Jump to: navigation, search
m (1 revision(s))
m
Line 9: Line 9:
 
<!--<idltopic>com.sun.star.form.XLoadable;com.sun.star.form.XLoadListener</idltopic>-->
 
<!--<idltopic>com.sun.star.form.XLoadable;com.sun.star.form.XLoadListener</idltopic>-->
 
A major difference of data forms compared to the underlying row set is the that forms are ''loaded'', and  provide an interface to manipulate this state.
 
A major difference of data forms compared to the underlying row set is the that forms are ''loaded'', and  provide an interface to manipulate this state.
 
+
<source lang="java">
 
   XLoadable xLoad = (XLoadable)FLTools.getParent(aControlModel, XLoadable.class);
 
   XLoadable xLoad = (XLoadable)FLTools.getParent(aControlModel, XLoadable.class);
 
   xLoad.reload();
 
   xLoad.reload();
 
+
</source>
 
Loading is the same as executing the underlying row set, that is, invoking the [http://api.openoffice.org/docs/common/ref/com/sun/star/sdbc/XRowSet.html#execute com.sun.star.sdbc.XRowSet:execute]() method. The <idl>com.sun.star.form.XLoadable</idl> is designed to fit the needs of a form document, for example, it a unloads an already loaded form.
 
Loading is the same as executing the underlying row set, that is, invoking the [http://api.openoffice.org/docs/common/ref/com/sun/star/sdbc/XRowSet.html#execute com.sun.star.sdbc.XRowSet:execute]() method. The <idl>com.sun.star.form.XLoadable</idl> is designed to fit the needs of a form document, for example, it a unloads an already loaded form.
  

Revision as of 20:15, 6 April 2008



A major difference of data forms compared to the underlying row set is the that forms are loaded, and provide an interface to manipulate this state.

  XLoadable xLoad = (XLoadable)FLTools.getParent(aControlModel, XLoadable.class);
  xLoad.reload();

Loading is the same as executing the underlying row set, that is, invoking the com.sun.star.sdbc.XRowSet:execute() method. The com.sun.star.form.XLoadable is designed to fit the needs of a form document, for example, it a unloads an already loaded form.

The example above shows how to reload a form. Reloading is executing the row set again. Using reload instead of execute has the advantage of advanced listener mechanisms:

Look at the com.sun.star.form.XLoadable interface. You can add a com.sun.star.form.XLoadListener. This listener not only tells you when load-related events have occurred that is achieved by the com.sun.star.sdbc.XRowSetListener, but also when they are about to happen. In a complex scenario where different listeners are added to different aspects of a form, you use the com.sun.star.form.XLoadable:reload() call to disable all other listeners temporarily. Re-executing a row set is a complex process, thus it triggers a lot of events that are only an after effect of the re-execution.

Template:Documentation/Note

An additional difference between loading and executing is the positioning of the row set: When using com.sun.star.sdbc.XRowSet:execute(), the set is positioned before the first record. When you use com.sun.star.form.XLoadable:load(), the set is positioned on the first record, as you would expect from a form.

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