1*cdf0e10cSrcweir<?xml version="1.0" encoding="UTF-8"?> 2*cdf0e10cSrcweir<helpdocument version="1.0"> 3*cdf0e10cSrcweir 4*cdf0e10cSrcweir<!-- 5*cdf0e10cSrcweir*********************************************************************** 6*cdf0e10cSrcweir * 7*cdf0e10cSrcweir * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 8*cdf0e10cSrcweir * 9*cdf0e10cSrcweir * Copyright 2000, 2010 Oracle and/or its affiliates. 10*cdf0e10cSrcweir * 11*cdf0e10cSrcweir * OpenOffice.org - a multi-platform office productivity suite 12*cdf0e10cSrcweir * 13*cdf0e10cSrcweir * This file is part of OpenOffice.org. 14*cdf0e10cSrcweir * 15*cdf0e10cSrcweir * OpenOffice.org is free software: you can redistribute it and/or modify 16*cdf0e10cSrcweir * it under the terms of the GNU Lesser General Public License version 3 17*cdf0e10cSrcweir * only, as published by the Free Software Foundation. 18*cdf0e10cSrcweir * 19*cdf0e10cSrcweir * OpenOffice.org is distributed in the hope that it will be useful, 20*cdf0e10cSrcweir * but WITHOUT ANY WARRANTY; without even the implied warranty of 21*cdf0e10cSrcweir * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 22*cdf0e10cSrcweir * GNU Lesser General Public License version 3 for more details 23*cdf0e10cSrcweir * (a copy is included in the LICENSE file that accompanied this code). 24*cdf0e10cSrcweir * 25*cdf0e10cSrcweir * You should have received a copy of the GNU Lesser General Public License 26*cdf0e10cSrcweir * version 3 along with OpenOffice.org. If not, see 27*cdf0e10cSrcweir * <http://www.openoffice.org/license.html> 28*cdf0e10cSrcweir * for a copy of the LGPLv3 License. 29*cdf0e10cSrcweir * 30*cdf0e10cSrcweir ************************************************************************ 31*cdf0e10cSrcweir --> 32*cdf0e10cSrcweir 33*cdf0e10cSrcweir 34*cdf0e10cSrcweir<meta> 35*cdf0e10cSrcweir <topic id="textshared0201170202xml" indexer="include" status="PUBLISH"> 36*cdf0e10cSrcweir <title xml-lang="en-US" id="tit">Events</title> 37*cdf0e10cSrcweir <filename>/text/shared/02/01170202.xhp</filename> 38*cdf0e10cSrcweir </topic> 39*cdf0e10cSrcweir </meta> 40*cdf0e10cSrcweir <body> 41*cdf0e10cSrcweir <section id="ereignisse"> 42*cdf0e10cSrcweir<bookmark xml-lang="en-US" branch="index" id="bm_id3150499"><bookmark_value>forms; events</bookmark_value> 43*cdf0e10cSrcweir <bookmark_value>events;in forms</bookmark_value> 44*cdf0e10cSrcweir</bookmark> 45*cdf0e10cSrcweir<paragraph xml-lang="en-US" id="hd_id3150499" role="heading" level="1" l10n="U" oldref="1"><link href="text/shared/02/01170202.xhp" name="Events">Events</link></paragraph> 46*cdf0e10cSrcweir <paragraph xml-lang="en-US" id="par_id3147043" role="paragraph" l10n="U" oldref="2">The<emph> Events </emph>tab page, allows you to assign a macro to certain events which occur in a form.</paragraph> 47*cdf0e10cSrcweir </section> 48*cdf0e10cSrcweir <section id="howtoget"> 49*cdf0e10cSrcweir <embed href="text/shared/00/00040501.xhp#formulareigenschaftenereignisse"/> 50*cdf0e10cSrcweir </section> 51*cdf0e10cSrcweir <paragraph xml-lang="en-US" id="par_id3159233" role="paragraph" l10n="U" oldref="3">To link an event with a macro, first write a macro that contains all the commands to be executed when the event happens. Then assign this macro to the respective event by clicking the <emph>... </emph>button beside the corresponding event. The<emph> Assign Macro </emph>dialog opens, where you can select the macro.</paragraph> 52*cdf0e10cSrcweir <paragraph xml-lang="en-US" id="par_id3149182" role="paragraph" l10n="U" oldref="29">The following actions can be configured individually, meaning that you can use your own dialogs to depict an action:</paragraph> 53*cdf0e10cSrcweir <list type="ordered"> 54*cdf0e10cSrcweir <listitem> 55*cdf0e10cSrcweir <paragraph xml-lang="en-US" id="par_id3166460" role="listitem" l10n="U" oldref="30">Displaying an error message,</paragraph> 56*cdf0e10cSrcweir </listitem> 57*cdf0e10cSrcweir </list> 58*cdf0e10cSrcweir <list type="ordered"> 59*cdf0e10cSrcweir <listitem> 60*cdf0e10cSrcweir <paragraph xml-lang="en-US" id="par_id3152996" role="listitem" l10n="U" oldref="31">Confirming a delete process (for data records),</paragraph> 61*cdf0e10cSrcweir </listitem> 62*cdf0e10cSrcweir </list> 63*cdf0e10cSrcweir <list type="ordered"> 64*cdf0e10cSrcweir <listitem> 65*cdf0e10cSrcweir <paragraph xml-lang="en-US" id="par_id3153541" role="listitem" l10n="U" oldref="32">Querying parameters,</paragraph> 66*cdf0e10cSrcweir </listitem> 67*cdf0e10cSrcweir </list> 68*cdf0e10cSrcweir <list type="ordered"> 69*cdf0e10cSrcweir <listitem> 70*cdf0e10cSrcweir <paragraph xml-lang="en-US" id="par_id3155261" role="listitem" l10n="U" oldref="33">Checking input when saving a data record.</paragraph> 71*cdf0e10cSrcweir </listitem> 72*cdf0e10cSrcweir </list> 73*cdf0e10cSrcweir <paragraph xml-lang="en-US" id="par_id3153127" role="paragraph" l10n="U" oldref="34">For example, you can issue a "confirm deletion" request such as "Really delete customer xyz?" when deleting a data record.</paragraph> 74*cdf0e10cSrcweir <paragraph xml-lang="en-US" id="par_id0409200920562590" role="note" l10n="NEW">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.</paragraph> 75*cdf0e10cSrcweir <paragraph xml-lang="en-US" id="par_id3150986" role="paragraph" l10n="U" oldref="4">The following lists and describes all events in a form that can be linked to a macro:</paragraph> 76*cdf0e10cSrcweir<sort order="asc"> 77*cdf0e10cSrcweir<section id="reset_update"> 78*cdf0e10cSrcweir <paragraph xml-lang="en-US" id="hd_id3147559" role="heading" level="2" l10n="U" 79*cdf0e10cSrcweir oldref="17">Before update</paragraph> 80*cdf0e10cSrcweir <paragraph xml-lang="en-US" id="par_id3149669" role="paragraph" l10n="U" oldref="56"><ahelp hid=".">The Before update event occurs before the control content changed by the user is written into the data source.</ahelp> The linked macro can, for example, prevent this action by returning "FALSE".</paragraph> 81*cdf0e10cSrcweir<bookmark xml-lang="en-US" branch="hid/EXTENSIONS_HID_EVT_AFTERUPDATE" id="bm_id3154073" localize="false"/> 82*cdf0e10cSrcweir<paragraph xml-lang="en-US" id="hd_id3153779" role="heading" level="2" l10n="U" 83*cdf0e10cSrcweir oldref="19">After update</paragraph> 84*cdf0e10cSrcweir <paragraph xml-lang="en-US" id="par_id3153360" role="paragraph" l10n="U" oldref="57"><ahelp hid="HID_EVT_AFTERUPDATE">The After update event occurs after the control content changed by the user has been written into the data source.</ahelp></paragraph> 85*cdf0e10cSrcweir<bookmark xml-lang="en-US" branch="hid/EXTENSIONS_HID_EVT_APPROVERESETTED" id="bm_id3154851" localize="false"/> 86*cdf0e10cSrcweir<paragraph xml-lang="en-US" id="hd_id3157909" role="heading" level="2" l10n="U" 87*cdf0e10cSrcweir oldref="36">Prior to reset</paragraph> 88*cdf0e10cSrcweir <paragraph xml-lang="en-US" id="par_id3155390" role="paragraph" l10n="U" oldref="51"><ahelp hid="HID_EVT_APPROVERESETTED">The<emph> Prior to reset </emph>event occurs before a form is reset.</ahelp> The linked macro can, for example, prevent this action by returning "FALSE".</paragraph> 89*cdf0e10cSrcweir <paragraph xml-lang="en-US" id="par_id3149236" role="paragraph" l10n="U" oldref="52">A form is reset if one of the following conditions is met:</paragraph> 90*cdf0e10cSrcweir <list type="ordered"> 91*cdf0e10cSrcweir <listitem> 92*cdf0e10cSrcweir <paragraph xml-lang="en-US" id="par_id3149164" role="listitem" l10n="U" oldref="53">The user presses an (HTML) button that is defined as a reset button.</paragraph> 93*cdf0e10cSrcweir </listitem> 94*cdf0e10cSrcweir <listitem> 95*cdf0e10cSrcweir <paragraph xml-lang="en-US" id="par_id3153666" role="listitem" l10n="U" oldref="54">A new and empty record is created in a form that is linked to a data source. For example, in the last record, the <emph>Next Record</emph> button may be pressed.</paragraph> 96*cdf0e10cSrcweir </listitem> 97*cdf0e10cSrcweir </list> 98*cdf0e10cSrcweir<bookmark xml-lang="en-US" branch="hid/EXTENSIONS_HID_EVT_RESETTED" id="bm_id3152473" localize="false"/> 99*cdf0e10cSrcweir<paragraph xml-lang="en-US" id="hd_id3156119" role="heading" level="2" l10n="U" 100*cdf0e10cSrcweir oldref="37">After resetting</paragraph> 101*cdf0e10cSrcweir <paragraph xml-lang="en-US" id="par_id3148563" role="paragraph" l10n="U" oldref="55"><ahelp hid="HID_EVT_RESETTED">The<emph> After resetting </emph>event occurs after a form has been reset.</ahelp></paragraph> 102*cdf0e10cSrcweir </section> 103*cdf0e10cSrcweir <section id="Section13"> 104*cdf0e10cSrcweir<bookmark xml-lang="en-US" branch="hid/EXTENSIONS_HID_EVT_SUBMITTED" id="bm_id3147084" localize="false"/> 105*cdf0e10cSrcweir<paragraph xml-lang="en-US" id="hd_id3150870" role="heading" level="2" l10n="U" 106*cdf0e10cSrcweir oldref="27">Before submitting</paragraph> 107*cdf0e10cSrcweir <paragraph xml-lang="en-US" id="par_id3159152" role="paragraph" l10n="U" oldref="28"><ahelp hid="HID_EVT_SUBMITTED">The<emph> Before submitting </emph>event occurs before the form data is sent.</ahelp></paragraph> 108*cdf0e10cSrcweir </section> 109*cdf0e10cSrcweir <section id="Section12"> 110*cdf0e10cSrcweir<bookmark xml-lang="en-US" branch="hid/EXTENSIONS_HID_EVT_LOADED" id="bm_id3151383" localize="false"/> 111*cdf0e10cSrcweir<paragraph xml-lang="en-US" id="hd_id3149167" role="heading" level="2" l10n="U" oldref="5">When loading</paragraph> 112*cdf0e10cSrcweir <paragraph xml-lang="en-US" id="par_id3156423" role="paragraph" l10n="U" oldref="6"><ahelp hid="HID_EVT_LOADED">The<emph> When loading </emph>event occurs directly after the form has been loaded.</ahelp></paragraph> 113*cdf0e10cSrcweir </section> 114*cdf0e10cSrcweir <section id="Section11"> 115*cdf0e10cSrcweir<bookmark xml-lang="en-US" branch="hid/EXTENSIONS_HID_EVT_RELOADING" id="bm_id3157320" localize="false"/> 116*cdf0e10cSrcweir<paragraph xml-lang="en-US" id="hd_id3148451" role="heading" level="2" l10n="U" 117*cdf0e10cSrcweir oldref="38">Before reloading</paragraph> 118*cdf0e10cSrcweir <paragraph xml-lang="en-US" id="par_id3154218" role="paragraph" l10n="U" oldref="39"><ahelp hid="HID_EVT_RELOADING">The<emph> Before reloading </emph>event occurs before the form is reloaded.</ahelp> The data content has not yet been refreshed.</paragraph> 119*cdf0e10cSrcweir </section> 120*cdf0e10cSrcweir <section id="Section10"> 121*cdf0e10cSrcweir<bookmark xml-lang="en-US" branch="hid/EXTENSIONS_HID_EVT_RELOADED" id="bm_id3154946" localize="false"/> 122*cdf0e10cSrcweir<paragraph xml-lang="en-US" id="hd_id3155102" role="heading" level="2" l10n="U" 123*cdf0e10cSrcweir oldref="40">When reloading</paragraph> 124*cdf0e10cSrcweir <paragraph xml-lang="en-US" id="par_id3157895" role="paragraph" l10n="U" oldref="41"><ahelp hid="HID_EVT_RELOADED">The<emph> When reloading </emph>event occurs directly after the form has been reloaded.</ahelp> The data content has already been refreshed.</paragraph> 125*cdf0e10cSrcweir </section> 126*cdf0e10cSrcweir <section id="Section9"> 127*cdf0e10cSrcweir<bookmark xml-lang="en-US" branch="hid/EXTENSIONS_HID_EVT_UNLOADING" id="bm_id3151116" localize="false"/> 128*cdf0e10cSrcweir<paragraph xml-lang="en-US" id="hd_id3152792" role="heading" level="2" l10n="U" 129*cdf0e10cSrcweir oldref="42">Before unloading</paragraph> 130*cdf0e10cSrcweir <paragraph xml-lang="en-US" id="par_id3152598" role="paragraph" l10n="U" oldref="43"><ahelp hid="HID_EVT_UNLOADING">The<emph> Before unloading </emph>event occurs before the form is unloaded; that is, separated from its data source.</ahelp></paragraph> 131*cdf0e10cSrcweir </section> 132*cdf0e10cSrcweir <section id="Section8"> 133*cdf0e10cSrcweir<bookmark xml-lang="en-US" branch="hid/EXTENSIONS_HID_EVT_UNLOADED" id="bm_id3152938" localize="false"/> 134*cdf0e10cSrcweir<paragraph xml-lang="en-US" id="hd_id3154145" role="heading" level="2" l10n="U" 135*cdf0e10cSrcweir oldref="44">When unloading</paragraph> 136*cdf0e10cSrcweir <paragraph xml-lang="en-US" id="par_id3154638" role="paragraph" l10n="U" oldref="45"><ahelp hid="HID_EVT_UNLOADED">The<emph> When unloading </emph>event occurs directly after the form has been unloaded; that is, separated from its data source.</ahelp></paragraph> 137*cdf0e10cSrcweir </section> 138*cdf0e10cSrcweir <section id="Section7"> 139*cdf0e10cSrcweir<bookmark xml-lang="en-US" branch="hid/EXTENSIONS_HID_EVT_CONFIRMDELETE" id="bm_id3154127" localize="false"/> 140*cdf0e10cSrcweir<paragraph xml-lang="en-US" id="hd_id3147426" role="heading" level="2" l10n="U" 141*cdf0e10cSrcweir oldref="25">Confirm deletion</paragraph> 142*cdf0e10cSrcweir <paragraph xml-lang="en-US" id="par_id3154988" role="paragraph" l10n="U" oldref="26"><ahelp hid="HID_EVT_CONFIRMDELETE">The<emph> Confirm deletion </emph>event occurs as soon as data has been deleted from the form.</ahelp> For example, the linked macro can request confirmation in a dialog.</paragraph> 143*cdf0e10cSrcweir </section> 144*cdf0e10cSrcweir <section id="Section6"> 145*cdf0e10cSrcweir<bookmark xml-lang="en-US" branch="hid/EXTENSIONS_HID_EVT_APPROVEROWCHANGE" id="bm_id3151351" localize="false"/> 146*cdf0e10cSrcweir<paragraph xml-lang="en-US" id="hd_id3149481" role="heading" level="2" l10n="U" 147*cdf0e10cSrcweir oldref="46">Before record action</paragraph> 148*cdf0e10cSrcweir <paragraph xml-lang="en-US" id="par_id3156007" role="paragraph" l10n="U" oldref="58"><ahelp hid="HID_EVT_APPROVEROWCHANGE">The<emph> Before record action </emph>event occurs before the current record is changed.</ahelp> For example, the linked macro can request confirmation in a dialog.</paragraph> 149*cdf0e10cSrcweir </section> 150*cdf0e10cSrcweir <section id="Section5"> 151*cdf0e10cSrcweir<bookmark xml-lang="en-US" branch="hid/EXTENSIONS_HID_EVT_ROWCHANGE" id="bm_id3150685" localize="false"/> 152*cdf0e10cSrcweir<paragraph xml-lang="en-US" id="hd_id3145749" role="heading" level="2" l10n="U" 153*cdf0e10cSrcweir oldref="47">After record action</paragraph> 154*cdf0e10cSrcweir <paragraph xml-lang="en-US" id="par_id3146975" role="paragraph" l10n="U" oldref="59"><ahelp hid="HID_EVT_ROWCHANGE">The<emph> After record action </emph>event occurs directly after the current record has been changed.</ahelp></paragraph> 155*cdf0e10cSrcweir </section> 156*cdf0e10cSrcweir <section id="Section4"> 157*cdf0e10cSrcweir<bookmark xml-lang="en-US" branch="hid/EXTENSIONS_HID_EVT_POSITIONING" id="bm_id3155413" localize="false"/> 158*cdf0e10cSrcweir<paragraph xml-lang="en-US" id="hd_id3154012" role="heading" level="2" l10n="U" 159*cdf0e10cSrcweir oldref="48">Before record change</paragraph> 160*cdf0e10cSrcweir <paragraph xml-lang="en-US" id="par_id3149664" role="paragraph" l10n="U" oldref="60"><ahelp hid="HID_EVT_POSITIONING">The<emph> Before record change </emph>event occurs before the current record pointer is changed.</ahelp>. For example, the linked macro can prevent this action by returning "FALSE".</paragraph> 161*cdf0e10cSrcweir </section> 162*cdf0e10cSrcweir <section id="Section3"> 163*cdf0e10cSrcweir<bookmark xml-lang="en-US" branch="hid/EXTENSIONS_HID_EVT_POSITIONED" id="bm_id3150420" localize="false"/> 164*cdf0e10cSrcweir<paragraph xml-lang="en-US" id="hd_id3157975" role="heading" level="2" l10n="U" 165*cdf0e10cSrcweir oldref="49">After record change</paragraph> 166*cdf0e10cSrcweir <paragraph xml-lang="en-US" id="par_id3154098" role="paragraph" l10n="U" oldref="61"><ahelp hid="HID_EVT_POSITIONED">The<emph> After record change </emph>event occurs directly after the current record pointer has been changed.</ahelp>.</paragraph> 167*cdf0e10cSrcweir </section> 168*cdf0e10cSrcweir <section id="Section2"> 169*cdf0e10cSrcweir<bookmark xml-lang="en-US" branch="hid/EXTENSIONS_HID_EVT_APPROVEPARAMETER" id="bm_id3149298" localize="false"/> 170*cdf0e10cSrcweir<paragraph xml-lang="en-US" id="hd_id3151076" role="heading" level="2" l10n="U" 171*cdf0e10cSrcweir oldref="50">Fill parameters</paragraph> 172*cdf0e10cSrcweir <paragraph xml-lang="en-US" id="par_id3147396" role="paragraph" l10n="U" oldref="62"><ahelp hid="HID_EVT_APPROVEPARAMETER">The<emph> Fill parameters </emph>event occurs when the form to be loaded has parameters that must be filled out.</ahelp> For example, the data source of the form can be the following SQL command:</paragraph> 173*cdf0e10cSrcweir <paragraph xml-lang="en-US" id="par_id3148773" role="paragraph" l10n="U" oldref="63">SELECT * FROM address WHERE name=:name</paragraph> 174*cdf0e10cSrcweir <paragraph xml-lang="en-US" id="par_id3149581" role="paragraph" l10n="U" oldref="64">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.</paragraph> 175*cdf0e10cSrcweir </section> 176*cdf0e10cSrcweir <section id="Section1"> 177*cdf0e10cSrcweir<bookmark xml-lang="en-US" branch="hid/EXTENSIONS_HID_EVT_ERROROCCURED" id="bm_id3148387" localize="false"/> 178*cdf0e10cSrcweir<paragraph xml-lang="en-US" id="hd_id3146926" role="heading" level="2" l10n="U" oldref="9">Error occurred</paragraph> 179*cdf0e10cSrcweir <paragraph xml-lang="en-US" id="par_id3149485" role="paragraph" l10n="U" oldref="10"><ahelp hid="HID_EVT_ERROROCCURED">The<emph> Error occurred </emph>event is activated if an error occurs when accessing the data source.</ahelp> This applies to forms, list boxes and combo boxes.</paragraph> 180*cdf0e10cSrcweir </section> 181*cdf0e10cSrcweir</sort> 182*cdf0e10cSrcweir</body> 183*cdf0e10cSrcweir</helpdocument>