From 8968f31fbb6dedd29d37bfb296b9d857c6d6bc5a Mon Sep 17 00:00:00 2001
From: Alain Romedenne
Date: Wed, 23 Sep 2020 16:29:07 +0200
Subject: tdf#92183 Database form events refresher
- h2 tags introduced
- vetoable routines that can be interrupted have been precised
- Added routine/interface API information as help index entries
- text/sbasic/shared/01170103.xhp page overlap with text/shared/02/01170103.xhp may have to be tackled later
Change-Id: I3416332140f6fbccbb9ff1d1e1b767c9bd8c3934
Reviewed-on: https://gerrit.libreoffice.org/c/help/+/103196
Tested-by: Jenkins
Reviewed-by: Olivier Hallot
---
source/text/shared/02/01170103.xhp | 36 +++++-----
source/text/shared/02/01170202.xhp | 143 ++++++++++++++++++++++++-------------
2 files changed, 114 insertions(+), 65 deletions(-)
(limited to 'source')
diff --git a/source/text/shared/02/01170103.xhp b/source/text/shared/02/01170103.xhp
index 69e9607fa4..24a83972e7 100644
--- a/source/text/shared/02/01170103.xhp
+++ b/source/text/shared/02/01170103.xhp
@@ -31,7 +31,7 @@
events; controlsmacros; assigning to events in forms
-Events
+
Events
On the Events tab page you can link macros to events that occur in a form's control fields.When the event occurs, the linked macro will be called. To assign a macro to an event, press the ... button. The Assign Action dialog opens.
@@ -40,51 +40,53 @@
Depending on the control, different events are available. Only the available events for the selected control and context are listed on the Events tab page. The following events are defined:
-Approve actionrenamed from Before commencing, issue 97356
+
Approve actionrenamed from Before commencing, issue 97356
This event takes place before an action is triggered by clicking the control. For example, clicking a "Submit" button initiates a send action; however, the actual "send" process is started only when the When initiating event occurs. The Approve action event allows you to kill the process. If the linked method sends back FALSE, When initiating will not be executed.
-Execute actionrenamed from When initiated, issue 97356
+
Execute actionrenamed from When initiated, issue 97356
The Execute action event occurs when an action is started. For example, if you have a "Submit" button in your form, the send process represents the action to be initiated.
-Changed
+
Changed
The Changed event takes place when the control loses the focus and the content of the control has changed since it lost the focus.
-Text modified
+
Text modified
The Text modified event takes place if you enter or modify a text in an input field.
-Item status changed
+
Item status changed
The Item status changed event takes place if the status of the control field has changed. The Item status changed event takes place if the status of the control field has changed.
-When receiving focus
+
When receiving focus
The When receiving focus event takes place if a control field receives the focus.
-When losing focus
+
When losing focus
The When losing focus event takes place if a control field loses the focus.
-Key pressed
+
Key pressed
The Key pressed event occurs when the user presses any key while the control has the focus. This event may be linked to a macro for checking entries.
-Key released
+
Key released
The Key released event occurs when the user releases any key while the control has the focus.
-Mouse inside
+
Mouse inside
The Mouse inside event takes place if the mouse is inside the control field.
-Mouse moved while key pressed
+
Mouse moved while key pressed
The Mouse moved while key pressed event takes place when the mouse is dragged while a key is pressed. An example is when, during drag-and-drop, an additional key determines the mode (move or copy).
-Mouse moved
+
Mouse moved
The Mouse moved event occurs if the mouse moves over the control.
-Mouse button pressed
+
Mouse button pressed
The Mouse button pressed event occurs if the mouse button is pressed while the mouse pointer is on the control.Note that this event is also used for notifying requests for a popup context menu on the control.
-Mouse button released
+
Mouse button released
The Mouse button released event occurs if the mouse button is released while the mouse pointer is on the control.
-Mouse outside
+
Mouse outside
The Mouse outside event takes place when the mouse is outside the control field.
-
+
+
+
-forms; events
- events;in forms
-
-Events
- The Events tab page, allows you to assign a macro to certain events which occur in a form.
+ forms; events
+ events;in database forms
+ forms;database events
+
+ Database Form Events
+ The Events tab page, allows you to assign a macro to certain events which occur in a database form.
@@ -54,99 +55,145 @@
For example, you can issue a "confirm deletion" request such as "Really delete customer xyz?" when deleting a data record.
- The events that are shown in the Events dialog cannot be edited directly. You can delete an event from the list by pressing the Del key.
- The following lists and describes all events in a form that can be linked to a macro:
+
+ The events that are shown in the Events dialog cannot be edited directly. You can remove an event from the list by pressing the Del key.
+
+ The following lists and describes all events in a form that can be linked to a macro:
+
+
-
- Before update
- The Before update event occurs before the control content changed by the user is written into the data source. The linked macro can, for example, prevent this action by returning "FALSE".
-
-After update
- The After update event occurs after the control content changed by the user has been written into the data source.
-
-Prior to reset
- The Prior to reset event occurs before a form is reset. The linked macro can, for example, prevent this action by returning "FALSE".
- A form is reset if one of the following conditions is met:
-
-
- The user presses an (HTML) button that is defined as a reset button.
-
-
- A new and empty record is created in a form that is linked to a data source. For example, in the last record, the Next Record button may be pressed.
-
-
-
-After resetting
- The After resetting event occurs after a form has been reset.
-
+
+
+ API;XUpdateListener
+
+
Before update
+ The Before update event occurs before the control content changed by the user is written into the data source. The linked macro can, for example, prevent this action by returning FALSE.
+
+
After update
+ The After update event occurs after the control content changed by the user has been written into the data source.
+
+
+ API;XResetListener
+
+
Prior to reset
+ The Prior to reset event occurs before a form is reset. Returning True approves the reset, returning False cancels the operation.
+ A form is reset if one of the following conditions is met:
+
+
+ The user presses an (HTML) button that is defined as a reset button.
+
+
+ A new and empty record is created in a form that is linked to a data source. For example, in the last record, the Next Record button may be pressed.
+
+
+
+
After resetting
+ The After resetting event occurs after a form has been reset.
+
+
-Before submitting
- The Before submitting event occurs before the form data is sent.
+
+ API;XSubmitListener
+ API;XSubmissionVetoListener
+
+
Before submitting
+ The Before submitting event occurs before the form data is sent. Returning True approves the submission, False stops it.
-When loading
+
+ API;XLoadListener
+
+
When loading
The When loading event occurs directly after the form has been loaded.
-Before reloading
+
Before reloading
The Before reloading event occurs before the form is reloaded. The data content has not yet been refreshed.
-When reloading
+
When reloading
The When reloading event occurs directly after the form has been reloaded. The data content has already been refreshed.
-Before unloading
+
Before unloading
The Before unloading event occurs before the form is unloaded; that is, separated from its data source.
-When unloading
+
When unloading
The When unloading event occurs directly after the form has been unloaded; that is, separated from its data source.
-Confirm deletion
- The Confirm deletion event occurs as soon as data has been deleted from the form. For example, the linked macro can request confirmation in a dialog.
+
+ API;XConfirmDeleteListener
+
+
Confirm deletion
+ The Confirm deletion event occurs as soon as data has been deleted from the form. Return True to allow row deletion, False otherwise. For example, the linked macro can request confirmation in a dialog.
-Before record action
- The Before record action event occurs before the current record is changed. For example, the linked macro can request confirmation in a dialog.
+
+ API;XRowSetApproveListener
+
+
Before record action
+ The Before record action event occurs before the current record or record set are changed. Return True when changing is allowed, otherwise False. For example, the linked macro can request confirmation in a dialog.
-After record action
+
+ API;XRowSetListener
+
+
After record action
The After record action event occurs directly after the current record has been changed.
-Before record change
- The Before record change event occurs before the current record pointer is changed. For example, the linked macro can prevent this action by returning "FALSE".
+
Before record change
+ The Before record change event occurs before the current record pointer - SQL cursor - is changed. Return True when moving is allowed, otherwise False.
-After record change
+
After record change
The After record change event occurs directly after the current record pointer has been changed.
-Fill parameters
+
+ API;XDatabaseParameterListener
+
+
Fill parameters
The Fill parameters event occurs when the form to be loaded has parameters that must be filled out. For example, the data source of the form can be the following SQL command:SELECT * FROM address WHERE name=:name
- Here :name is a parameter that must be filled out when loading. The parameter is automatically filled out from the parent form if possible. If the parameter cannot be filled out, this event is called and a linked macro can fill out the parameter.
+ Here :name is a parameter that must be filled out when loading. The parameter is automatically filled out from the parent form if possible. If the parameter cannot be filled out, this event is called and a linked macro can fill out the parameter. Return True when the execution of the parametrized statement should continue, False otherwise.
-Error occurred
+
+ API;XSQLErrorListener
+
+
Error occurred
The Error occurred event is activated if an error occurs when accessing the data source. This applies to forms, list boxes and combo boxes.
+
+
Vetoable events
+Macros can interrupt event execution when they return a boolean value: True allows the execution of the event to continue and False stops the event execution.
+
+ The following events are interruptable by returning False:
+
+ Before record action
+ Before record change
+ Before submitting
+ Before update
+ Fill parameters
+
+