Difference between revisions of "Documentation/DevGuide/Forms/Loadable Forms"
(Initial author Sun Microsystems, Inc.) |
m |
||
(8 intermediate revisions by 5 users not shown) | |||
Line 6: | Line 6: | ||
|NextPage=Documentation/DevGuide/Forms/Sub Forms | |NextPage=Documentation/DevGuide/Forms/Sub Forms | ||
}} | }} | ||
− | {{DISPLAYTITLE:Loadable Forms}} | + | {{Documentation/DevGuideLanguages|Documentation/DevGuide/Forms/{{SUBPAGENAME}}}} |
+ | {{DISPLAYTITLE:Loadable Forms}} | ||
<!--<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. | ||
− | + | <syntaxhighlight lang="java"> | |
XLoadable xLoad = (XLoadable)FLTools.getParent(aControlModel, XLoadable.class); | XLoadable xLoad = (XLoadable)FLTools.getParent(aControlModel, XLoadable.class); | ||
xLoad.reload(); | xLoad.reload(); | ||
− | + | </syntaxhighlight> | |
− | Loading is the same as executing the underlying row set, that is, invoking the | + | Loading is the same as executing the underlying row set, that is, invoking the <idlm>com.sun.star.sdbc.XRowSet:execute</idlm>() method. The <idl>com.sun.star.form.XLoadable</idl> is designed to fit the needs of a form document, for example, it unloads an already loaded form. |
The example above shows how to reload a form. Reloading is executing the row set again. Using <code>reload</code> instead of <code>execute</code> has the advantage of advanced listener mechanisms: | The example above shows how to reload a form. Reloading is executing the row set again. Using <code>reload</code> instead of <code>execute</code> has the advantage of advanced listener mechanisms: | ||
− | Look at the <idl>com.sun.star.form.XLoadable</idl> interface. You can add a <idl>com.sun.star.form.XLoadListener</idl>. This listener not only tells you when load-related events have occurred that is achieved by the <idl>com.sun.star.sdbc.XRowSetListener</idl>, 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 | + | Look at the <idl>com.sun.star.form.XLoadable</idl> interface. You can add a <idl>com.sun.star.form.XLoadListener</idl>. This listener not only tells you when load-related events have occurred that is achieved by the <idl>com.sun.star.sdbc.XRowSetListener</idl>, 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 <idlm>com.sun.star.form.XLoadable:reload</idlm>() 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. |
− | {{ | + | {{Note|Though all the functionality provided by <idl>com.sun.star.form.XLoadable</idl> can be simulated using the <idl>com.sun.star.sdbc.XRowSet</idl> interface, you should always use the former. Due to the above-mentioned, more sophisticated listener mechanisms, implementations have a chance to do loading, reloading and unloading much smoother then.}} |
− | An additional difference between loading and executing is the positioning of the row set: When using | + | An additional difference between loading and executing is the positioning of the row set: When using <idlm>com.sun.star.sdbc.XRowSet:execute</idlm>(), the set is positioned ''before'' the first record. When you use <idlm>com.sun.star.form.XLoadable:load</idlm>(), the set is positioned ''on'' the first record, as you would expect from a form. |
{{PDL1}} | {{PDL1}} | ||
− | [[Category: Forms]] | + | |
+ | [[Category:Documentation/Developer's Guide/Forms]] |
Latest revision as of 11:41, 16 January 2024
- Forms as Row Sets
- Loadable Forms
- Sub Forms
- Filtering and Sorting
- Parameters
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 execute() method. The com.sun.star.form.XLoadable is designed to fit the needs of a form document, for example, it 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 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.
Though all the functionality provided by com.sun.star.form.XLoadable can be simulated using the com.sun.star.sdbc.XRowSet interface, you should always use the former. Due to the above-mentioned, more sophisticated listener mechanisms, implementations have a chance to do loading, reloading and unloading much smoother then. |
An additional difference between loading and executing is the positioning of the row set: When using execute(), the set is positioned before the first record. When you use 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). |