Difference between revisions of "Event Delegate Sequences"

From Lianjapedia
Jump to: navigation, search
(Form Section)
 
(46 intermediate revisions by 2 users not shown)
Line 1: Line 1:
''Under Construction''
+
{{DISPLAYTITLE:Event Sequences}}
 
+
 
=See Also=
 
=See Also=
[[Custom Delegates]]
+
[[Custom Delegates]], [[:Category:Database Triggers|Database Triggers]],
  
 
=Opening and Closing=
 
=Opening and Closing=
Line 9: Line 8:
  
 
===Desktop===
 
===Desktop===
When a Desktop App is opened, the following event delegates are called:
+
When a Desktop App is opened, the following [[:Category:Database_Triggers|database events and table triggers]] are called:
 +
 
 +
* [[DBC_OPENDATA]] database event
 +
* [[ONOPEN Table Constraint|ONOPEN]] table trigger
 +
 
 +
And the following event delegates are called:
  
 
* init
 
* init
 
* visiblewhen, enabledwhen (runtime only)
 
* visiblewhen, enabledwhen (runtime only)
 
* load
 
* load
* datachanged, parentdatachanged, refresh
+
* datachanged, parentdatachanged, refresh, afterrefresh
 
* ready
 
* ready
 
* resized (Canvas and Custom Sections)
 
* resized (Canvas and Custom Sections)
Line 75: Line 79:
 
'''DATACHANGED'''
 
'''DATACHANGED'''
  
The DATACHANGED event is called for Form Sections and their Fields.
+
The DATACHANGED event is called for data-bound Canvas Sections and Form Sections and their Fields.
  
 
'''PARENTDATACHANGED'''
 
'''PARENTDATACHANGED'''
Line 84: Line 88:
  
 
The REFRESH event is called for Sections.
 
The REFRESH event is called for Sections.
 +
 +
'''AFTERREFRESH'''
 +
 +
The AFTERREFRESH event is called for Sections.
  
 
'''READY'''
 
'''READY'''
Line 114: Line 122:
  
 
===Web/Mobile App===
 
===Web/Mobile App===
When a Web/Mobile App is opened, the following event delegates are called:
+
When a Web/Mobile App is opened, the following [[:Category:Database_Triggers|database events and table triggers]] are called:
 +
 
 +
* [[DBC_OPENDATA]] database event
 +
* [[ONOPEN Table Constraint|ONOPEN]] table trigger
 +
* [[ONCLOSE Table Constraint|ONCLOSE]] table trigger
 +
* [[DBC_CLOSEDATA]] database event
 +
 
 +
And the following event delegates are called:
 +
 
 +
* init
 +
* load
 +
* datachanged, parentdatachanged, refresh, afterrefresh
 +
* ready
 +
* resized (Canvas and Custom Sections)
 +
* activate
  
 
'''INIT'''
 
'''INIT'''
 
* App
 
* App
 
** Page1
 
** Page1
*** Section1 Field1 ... FieldN
+
*** FormSection1 Field1 ... FieldN
 +
*** ...
 
** Page2
 
** Page2
 +
*** FormSection1 Field1 ... FieldN
 +
*** ...
 
** ...
 
** ...
 +
*** ...
 
** PageN
 
** PageN
 +
*** FormSection1 Field1 ... FieldN
 +
*** ...
  
 
'''LOAD'''
 
'''LOAD'''
 
* App
 
* App
 
** Page1
 
** Page1
*** Section1 Field1 ... FieldN
+
*** FormSection1 Field1 ... FieldN
 +
*** ...
 
** Page2
 
** Page2
 +
*** FormSection1 Field1 ... FieldN
 +
*** ...
 
** ...
 
** ...
 +
*** ...
 
** PageN
 
** PageN
 +
*** FormSection1 Field1 ... FieldN
 +
*** ...
  
 
'''READY'''
 
'''READY'''
 
* App
 
* App
 
** Page1
 
** Page1
*** Section1 Field1 ... FieldN
+
*** FormSection1 Field1 ... FieldN
 +
*** ...
 
** Page2
 
** Page2
 +
*** FormSection1 Field1 ... FieldN
 +
*** ...
 
** ...
 
** ...
 +
*** ...
 
** PageN
 
** PageN
 +
*** FormSection1 Field1 ... FieldN
 +
*** ...
 +
 +
'''DATACHANGED'''
 +
 +
The DATACHANGED event is called for data-bound Canvas Sections,Grid Sections and Form Sections.
 +
 +
'''PARENTDATACHANGED'''
 +
 +
The PARENTDATACHANGED event is called for related child Sections.
 +
 +
'''REFRESH'''
 +
 +
The REFRESH event is called for Sections.
 +
 +
'''AFTERREFRESH'''
 +
 +
The AFTERREFRESH event is called for Sections.
  
 
'''RESIZED'''
 
'''RESIZED'''
Line 146: Line 202:
 
'''ACTIVATE'''
 
'''ACTIVATE'''
 
* Page1 (or Page specified in the App 'Initial Page' attribute or first Page user has permission to read)
 
* Page1 (or Page specified in the App 'Initial Page' attribute or first Page user has permission to read)
 
  
 
==Closing an App==
 
==Closing an App==
  
 
===Desktop===
 
===Desktop===
When a Desktop App is closed, the following event delegates are called:
+
When a Desktop App is closed, the following [[:Category:Database_Triggers|database events and table triggers]] are called:
 +
 
 +
* [[DBC_CLOSEDATA]] database event
 +
* [[ONCLOSE Table Constraint|ONCLOSE]] table trigger
 +
 
 +
And the following event delegates are called:
  
 
'''UNLOAD and DESTROY'''
 
'''UNLOAD and DESTROY'''
Line 182: Line 242:
 
* App UNLOAD
 
* App UNLOAD
 
* App DESTROY
 
* App DESTROY
 
The database is closed, running dbc_closedata.prg if it exists in the database's directory. Tables are closed, running the tables' onclose trigger if applicable.
 
  
 
===Web/Mobile App===
 
===Web/Mobile App===
 +
When a Web/Mobile App is closed, the following [[:Category:Database_Triggers|database events and table triggers]] are called:
 +
 +
* None
 +
 +
And the following event delegates are called:
  
 
* None
 
* None
Line 203: Line 266:
 
** SectionN
 
** SectionN
 
*** Field1 ... FieldN
 
*** Field1 ... FieldN
 +
 +
'''RESIZED'''
 +
* Page2
 +
** Canvas or Custom Sections
 +
 +
'''DATACHANGED'''
 +
* Page 2
 +
** Data-bound Canvas Sections and Form Sections and their fields
 +
 +
'''PARENTDATACHANGED'''
 +
* Page2
 +
** Related child sections
 +
 +
'''REFRESH'''
 +
* Page 2
 +
** Section1
 +
** ...
 +
** SectionN
 +
 +
'''AFTERREFRESH'''
 +
* Page 2
 +
** Section1
 +
** ...
 +
** SectionN
  
 
'''ACTIVATE'''
 
'''ACTIVATE'''
Line 228: Line 315:
 
'''ACTIVATE'''
 
'''ACTIVATE'''
 
* Page2
 
* Page2
 +
 +
'''DATACHANGED'''
 +
* Page 2
 +
** Data-bound Canvas Sections, Form Sections and Grid Sections
 +
 +
'''PARENTDATACHANGED'''
 +
* Page2
 +
** Related child sections
 +
 +
'''RESIZED'''
 +
* Page2
 +
** Canvas or Custom Sections
 +
 +
'''REFRESH'''
 +
* Page 2
 +
** Section1
 +
** ...
 +
** SectionN
 +
 +
'''AFTERREFRESH'''
 +
* Page 2
 +
** Section1
 +
** ...
 +
** SectionN
  
 
==Navigating Form Section==
 
==Navigating Form Section==
Line 235: Line 346:
  
 
* FormSection DATACHANGED
 
* FormSection DATACHANGED
* FormSection REFRESH
+
* FormSection REFRESH and AFTERREFRESH
 
** Field1 ... FieldN DATACHANGED
 
** Field1 ... FieldN DATACHANGED
 
* RelatedSection PARENTDATACHANGED
 
* RelatedSection PARENTDATACHANGED
* RelatedSection DATACHANGED (if Form Section)
+
* RelatedSection DATACHANGED (Canvas/Form Section)
* RelatedSection REFRESH (if Form Section)
+
* RelatedSection REFRESH and AFTERREFRESH (Canvas/Form Section)
** Field1 ... FieldN DATACHANGED (if Form Section)
+
** Field1 ... FieldN DATACHANGED (Form Section)
 +
* Page REFRESH and AFTERREFRESH
  
 
===Web/Mobile App===
 
===Web/Mobile App===
 
Using Page actionbar
 
Using Page actionbar
  
* None
+
* FormSection DATACHANGED
 +
* FormSection REFRESH and AFTERREFRESH
 +
* RelatedSection PARENTDATACHANGED
 +
* RelatedSection DATACHANGED
 +
* RelatedSection REFRESH and AFTERREFRESH
  
 
==Navigating Grid Section==
 
==Navigating Grid Section==
Line 254: Line 370:
 
* GridSection CLICK
 
* GridSection CLICK
 
* RelatedSection PARENTDATACHANGED
 
* RelatedSection PARENTDATACHANGED
* RelatedSection DATACHANGED (if Form Section)
+
* RelatedSection DATACHANGED (Canvas/Form Section)
* RelatedSection REFRESH (if Form Section)
+
* RelatedSection REFRESH and AFTERREFRESH (Canvas/Form Section)
** Field1 ... FieldN DATACHANGED (if Form Section)
+
** Field1 ... FieldN DATACHANGED (Form Section)
  
 
===Web/Mobile App===
 
===Web/Mobile App===
 
From row to row (mouse) or using Page navigation buttons in the Grid Section actionbar
 
From row to row (mouse) or using Page navigation buttons in the Grid Section actionbar
  
* None
+
* GridSection CLICK
 +
* RelatedSection PARENTDATACHANGED
 +
* RelatedSection DATACHANGED
 +
* RelatedSection REFRESH and AFTERREFRESH
  
 
=Data Operations=
 
=Data Operations=
Line 268: Line 387:
  
 
===Desktop===
 
===Desktop===
 
+
When adding a new record, the following events are called:
When the 'Add New Record' button in the Page actionbar or the 'Add' button in the Section actionbar is clicked, the following events are called:
+
  
 
'''BEFORECREATE'''
 
'''BEFORECREATE'''
Line 275: Line 393:
 
* Section
 
* Section
  
'''ONBEFOREINSERT'''
+
'''AFTERCREATE'''
  
If it exists, the bound table's [[ONBEFOREINSERT Table Constraint|ONBEFOREINSERT]] trigger is called.
+
* Section
  
'''ONAFTERINSERT'''
+
'''DATACHANGED'''
  
If it exists, the bound table's [[ONAFTERINSERT Table Constraint|ONAFTERINSERT]] trigger is called.
+
* Field1 ... FieldN DATACHANGED
  
'''AFTERCREATE'''
+
'''GOTFOCUS'''
 +
 
 +
* Field1
 +
 
 +
'''INITFORMDEFAULTS'''
  
 
* Section
 
* Section
  
'''REFRESH, DATACHANGED and PARENTDATACHANGED'''
+
'''REFRESH, AFTERREFRESH, DATACHANGED and PARENTDATACHANGED'''
  
* Section REFRESH
 
** Field1 ... FieldN DATACHANGED
 
 
* RelatedSection PARENTDATACHANGED  
 
* RelatedSection PARENTDATACHANGED  
* RelatedSection DATACHANGED (if Form Section)
+
* RelatedSection DATACHANGED (Canvas/Form Section)
* RelatedSection REFRESH (if Form Section)
+
** Field1 ... FieldN DATACHANGED (Form Section)
** Field1 ... FieldN DATACHANGED if Form Section)
+
* RelatedSection REFRESH and AFTERREFRESH (Canvas/Form Section)
 +
* Page REFRESH and AFTERREFRESH
  
 +
Saving the newly added record calls the following [[:Category:Database_Triggers|database events and table triggers]]:
  
Updating and saving the newly added record calls the events as in [[#Updating a record|Updating a record]] below.
+
* [[ONBEFOREINSERT Table Constraint|ONBEFOREINSERT]] table trigger
 +
* [[DBC_BEFOREINSERT]] database event
 +
* [[ONAFTERINSERT Table Constraint|ONAFTERINSERT]] table trigger
 +
* [[DBC_AFTERINSERT]] database event
  
 +
And the events as in [[#Updating a record|Updating a record]] below.
  
 
If the 'Undo Change' button in the Page actionbar or the 'Revert' button in the Section actionbar is clicked, the events called are as in [[#Deleting a record|Deleting a record]] below.
 
If the 'Undo Change' button in the Page actionbar or the 'Revert' button in the Section actionbar is clicked, the events called are as in [[#Deleting a record|Deleting a record]] below.
  
 
===Web/Mobile App===
 
===Web/Mobile App===
Updating and saving the newly added record calls the events as in [[#Updating a record|Updating a record]] below.
+
When a new record is saved, the following [[:Category:Database_Triggers|database events and table triggers]] are called:
 +
 
 +
* [[DBC_OPENDATA]] database event
 +
* [[ONOPEN Table Constraint|ONOPEN]] table trigger
 +
* [[DBC_BEFOREINSERT]] database event
 +
* [[ONBEFOREINSERT Table Constraint|ONBEFOREINSERT]] table trigger
 +
* [[ONAFTERINSERT Table Constraint|ONAFTERINSERT]] table trigger
 +
* [[DBC_AFTERINSERT]] database event
 +
* [[ONCLOSE Table Constraint|ONCLOSE]] table trigger
 +
* [[DBC_CLOSEDATA]] database event
 +
 
 +
And the events as in [[#Updating a record|Updating a record]] below.
  
 
==Updating a record==
 
==Updating a record==
Line 332: Line 469:
 
This and subsequent events are called after the save of a full Section or inline field edit.
 
This and subsequent events are called after the save of a full Section or inline field edit.
 
* Section
 
* Section
 
'''ONBEFOREUPDATE'''
 
 
If it exists, the bound table's [[ONBEFOREUPDATE Table Constraint|ONBEFOREUPDATE]] trigger is called.
 
 
'''ONAFTERUPDATE'''
 
 
If it exists, the bound table's [[ONAFTERUPDATE Table Constraint|ONAFTERUPDATE]] trigger is called.
 
  
 
'''AFTERUPDATE'''
 
'''AFTERUPDATE'''
Line 345: Line 474:
 
* Section
 
* Section
  
'''REFRESH, DATACHANGED and PARENTDATACHANGED'''
+
'''REFRESH, AFTERREFRESH, DATACHANGED and PARENTDATACHANGED'''
  
* Section REFRESH
+
* Section REFRESH and AFTERREFRESH
 
* Section DATACHANGED
 
* Section DATACHANGED
 
** Field1 ... FieldN DATACHANGED
 
** Field1 ... FieldN DATACHANGED
 
* RelatedSection PARENTDATACHANGED
 
* RelatedSection PARENTDATACHANGED
* RelatedSection DATACHANGED (if Form Section)
+
* RelatedSection DATACHANGED (Canvas/Form Section)
* RelatedSection REFRESH (if Form Section)
+
* RelatedSection REFRESH and AFTERREFRESH (Canvas/Form Section)
** Field1 ... FieldN DATACHANGED (if Form Section)
+
** Field1 ... FieldN DATACHANGED (Form Section)
 +
 
 +
Saving the updated record also calls the following [[:Category:Database_Triggers|database events and table triggers]]:
 +
 
 +
* [[DBC_BEFOREUPDATE]] database event
 +
* [[ONBEFOREUPDATE Table Constraint|ONBEFOREUPDATE]] table trigger
 +
* [[ONAFTERUPDATE Table Constraint|ONAFTERUPDATE]] table trigger
 +
* [[DBC_AFTERUPDATE]] database event
  
 
====Canvas Section====
 
====Canvas Section====
Line 383: Line 519:
 
'''VALIDATION'''
 
'''VALIDATION'''
  
If specified, the VALIDATION Attribute expression is checked for each modified field.
+
If specified, the VALIDATION Attribute expression is checked for each modified field on exiting the field.
  
 
'''LOSTFOCUS'''
 
'''LOSTFOCUS'''
Line 397: Line 533:
  
 
* Section
 
* Section
 
'''ONBEFOREUPDATE'''
 
 
If it exists, the bound table's [[ONBEFOREUPDATE Table Constraint|ONBEFOREUPDATE]] trigger is called.
 
 
'''ONAFTERUPDATE'''
 
 
If it exists, the bound table's [[ONAFTERUPDATE Table Constraint|ONAFTERUPDATE]] trigger is called.
 
  
 
'''AFTERUPDATE'''
 
'''AFTERUPDATE'''
Line 410: Line 538:
 
* Section
 
* Section
  
'''REFRESH, DATACHANGED and PARENTDATACHANGED'''
+
'''REFRESH, AFTERREFRESH, DATACHANGED and PARENTDATACHANGED'''
  
* Section REFRESH
+
* Section REFRESH and AFTERREFRESH
 
** Field1 ... FieldN DATACHANGED
 
** Field1 ... FieldN DATACHANGED
* RelatedSection DATACHANGED (if Form Section)
+
* RelatedSection PARENTDATACHANGED
* RelatedSection REFRESH (if Form Section)
+
* RelatedSection DATACHANGED (Canvas/Form Section)
** Field1 ... FieldN DATACHANGED (if Form Section)
+
* RelatedSection REFRESH and AFTERREFRESH (Canvas/Form Section)
 +
** Field1 ... FieldN DATACHANGED (Form Section)
 +
 
 +
Saving the updated record also calls the following [[:Category:Database_Triggers|database events and table triggers]]:
 +
 
 +
* [[DBC_BEFOREUPDATE]] database event
 +
* [[ONBEFOREUPDATE Table Constraint|ONBEFOREUPDATE]] table trigger
 +
* [[ONAFTERUPDATE Table Constraint|ONAFTERUPDATE]] table trigger
 +
* [[DBC_AFTERUPDATE]] database event
  
 
====Grid Section====
 
====Grid Section====
 +
 +
'''VALIDATION'''
 +
 +
If specified, the VALIDATION Attribute expression is checked on exiting a modified cell.
 +
 
The following events are called after clicking the Grid Section actionbar 'Save' button or moving to another grid row after modifying a Grid Section column.
 
The following events are called after clicking the Grid Section actionbar 'Save' button or moving to another grid row after modifying a Grid Section column.
  
Line 428: Line 569:
  
 
* Section
 
* Section
 
'''ONBEFOREUPDATE'''
 
 
If it exists, the bound table's [[ONBEFOREUPDATE Table Constraint|ONBEFOREUPDATE]] trigger is called.
 
 
'''ONAFTERUPDATE'''
 
 
If it exists, the bound table's [[ONAFTERUPDATE Table Constraint|ONAFTERUPDATE]] trigger is called.
 
  
 
'''AFTERUPDATE'''
 
'''AFTERUPDATE'''
Line 443: Line 576:
 
'''Changed'''
 
'''Changed'''
  
** Section
+
* Section
 
* Page
 
* Page
 +
 +
Saving the updated record also calls the following [[:Category:Database_Triggers|database events and table triggers]]:
 +
 +
* [[DBC_BEFOREUPDATE]] database event
 +
* [[ONBEFOREUPDATE Table Constraint|ONBEFOREUPDATE]] table trigger
 +
* [[ONAFTERUPDATE Table Constraint|ONAFTERUPDATE]] table trigger
 +
* [[DBC_AFTERUPDATE]] database event
  
 
===Web/Mobile App===
 
===Web/Mobile App===
Line 457: Line 597:
  
 
The INTERACTIVECHANGE event is called on each entered keypress for editable fields.
 
The INTERACTIVECHANGE event is called on each entered keypress for editable fields.
 +
 +
'''VALIDATION'''
 +
 +
If specified, the VALIDATION Attribute expression is checked on exiting a modified field.
  
 
'''CHANGED'''
 
'''CHANGED'''
Line 465: Line 609:
  
 
The LOSTFOCUS event is called on editable fields.
 
The LOSTFOCUS event is called on editable fields.
 +
 +
After the save of a full Section or inline field edit:
 +
 +
'''BEFOREUPDATE'''
 +
 +
* Section
 +
 +
'''AFTERUPDATE'''
 +
 +
* Section
 +
 +
'''REFRESH, AFTERREFRESH, DATACHANGED and PARENTDATACHANGED'''
 +
 +
* Section REFRESH and AFTERREFRESH
 +
* Section DATACHANGED
 +
** Field1 ... FieldN DATACHANGED
 +
* RelatedSection PARENTDATACHANGED
 +
* RelatedSection DATACHANGED
 +
* RelatedSection REFRESH and AFTERREFRESH
 +
 +
Saving the updated record also calls the following [[:Category:Database_Triggers|database events and table triggers]]:
 +
 +
* [[DBC_OPENDATA]] database event
 +
* [[ONOPEN Table Constraint|ONOPEN]] table trigger
 +
* [[DBC_BEFOREUPDATE]] database event
 +
* [[ONBEFOREUPDATE Table Constraint|ONBEFOREUPDATE]] table trigger
 +
* [[ONAFTERUPDATE Table Constraint|ONAFTERUPDATE]] table trigger
 +
* [[DBC_AFTERUPDATE]] database event
 +
* [[ONCLOSE Table Constraint|ONCLOSE]] table trigger
 +
* [[DBC_CLOSEDATA]] database event
  
 
====Canvas Section====
 
====Canvas Section====
Line 495: Line 669:
  
 
The MOUSELEAVE event is called on editable fields.
 
The MOUSELEAVE event is called on editable fields.
 +
 +
After save is clicked:
 +
 +
'''BEFOREUPDATE'''
 +
 +
* Section
 +
 +
'''AFTERUPDATE'''
 +
 +
* Section
 +
 +
'''REFRESH, AFTERREFRESH, DATACHANGED and PARENTDATACHANGED'''
 +
 +
* Section REFRESH and AFTERREFRESH
 +
* Section DATACHANGED
 +
* RelatedSection PARENTDATACHANGED
 +
* RelatedSection DATACHANGED
 +
* RelatedSection REFRESH and AFTERREFRESH
 +
 +
Saving the updated record also calls the following [[:Category:Database_Triggers|database events and table triggers]]:
 +
 +
* [[DBC_OPENDATA]] database event
 +
* [[ONOPEN Table Constraint|ONOPEN]] table trigger
 +
* [[DBC_BEFOREUPDATE]] database event
 +
* [[ONBEFOREUPDATE Table Constraint|ONBEFOREUPDATE]] table trigger
 +
* [[ONAFTERUPDATE Table Constraint|ONAFTERUPDATE]] table trigger
 +
* [[DBC_AFTERUPDATE]] database event
 +
* [[ONCLOSE Table Constraint|ONCLOSE]] table trigger
 +
* [[DBC_CLOSEDATA]] database event
  
 
====Grid Section====
 
====Grid Section====
 
The following events are called after editing and saving a Grid Section row in the 'Edit Record' dialog.
 
The following events are called after editing and saving a Grid Section row in the 'Edit Record' dialog.
  
* None
+
'''REFRESH, AFTERREFRESH, DATACHANGED and PARENTDATACHANGED'''
 +
 
 +
* Section REFRESH and AFTERREFRESH
 +
* Section DATACHANGED
 +
* RelatedSection PARENTDATACHANGED
 +
* RelatedSection DATACHANGED
 +
* RelatedSection REFRESH and AFTERREFRESH
 +
 
 +
Saving the updated record also calls the following [[:Category:Database_Triggers|database events and table triggers]]:
 +
 
 +
* [[DBC_OPENDATA]] database event
 +
* [[ONOPEN Table Constraint|ONOPEN]] table trigger
 +
* [[DBC_BEFOREUPDATE]] database event
 +
* [[ONBEFOREUPDATE Table Constraint|ONBEFOREUPDATE]] table trigger
 +
* [[ONAFTERUPDATE Table Constraint|ONAFTERUPDATE]] table trigger
 +
* [[DBC_AFTERUPDATE]] database event
 +
* [[ONCLOSE Table Constraint|ONCLOSE]] table trigger
 +
* [[DBC_CLOSEDATA]] database event
  
 
==Deleting a record==
 
==Deleting a record==
  
 
===Desktop===
 
===Desktop===
 
+
When record deletion is confirmed, the following events are called:
When the 'Delete Record' button in the Page actionbar or the 'Delete' button in the Section actionbar is clicked, the following events are called:
+
  
 
'''BEFOREDELETE'''
 
'''BEFOREDELETE'''
Line 511: Line 730:
 
* Section
 
* Section
  
'''ONBEFOREDELETE'''
+
'''AFTERDELETE'''
  
If it exists, the bound table's [[ONBEFOREDELETE Table Constraint|ONBEFOREDELETE]] trigger is called.
+
* Section
  
'''ONAFTERDELETE'''
+
'''REFRESH, DATACHANGED and PARENTDATACHANGED'''
 +
 
 +
* Section DATACHANGED
 +
* Section REFRESH and AFTERREFRESH
 +
** Field1 ... FieldN DATACHANGED
 +
* RelatedSection PARENTDATACHANGED
 +
* RelatedSection DATACHANGED (Canvas/Form Section)
 +
* RelatedSection REFRESH and AFTERREFRESH (Canvas/Form Section)
 +
** Field1 ... FieldN DATACHANGED (Form Section)
 +
 
 +
And also calls the following [[:Category:Database_Triggers|database events and table triggers]]:
 +
 
 +
* [[DBC_BEFOREDELETE]] database event
 +
* [[ONBEFOREDELETE Table Constraint|ONBEFOREDELETE]] table trigger
 +
* [[ONAFTERDELETE Table Constraint|ONAFTERDELETE]] table trigger
 +
* [[DBC_AFTERDELETE]] database event
 +
 
 +
===Web/Mobile App===
 +
When deleting a record, the following events are called:
 +
 
 +
'''BEFOREDELETE'''
 +
 
 +
* Section
  
If it exists, the bound table's [[ONAFTERDELETE Table Constraint|ONAFTERDELETE]] trigger is called.
+
and after record deletion is confirmed:
  
 
'''AFTERDELETE'''
 
'''AFTERDELETE'''
Line 523: Line 764:
 
* Section
 
* Section
  
'''REFRESH, DATACHANGED and PARENTDATACHANGED'''
+
'''REFRESH, AFTERREFRESH, DATACHANGED and PARENTDATACHANGED'''
  
 
* Section DATACHANGED  
 
* Section DATACHANGED  
* Section REFRESH
+
* Section REFRESH and AFTERREFRESH
** Field1 ... FieldN DATACHANGED
+
 
* RelatedSection PARENTDATACHANGED  
 
* RelatedSection PARENTDATACHANGED  
* RelatedSection DATACHANGED (if Form Section)
+
* RelatedSection DATACHANGED
* RelatedSection REFRESH (if Form Section)
+
* RelatedSection REFRESH and AFTERREFRESH
** Field1 ... FieldN DATACHANGED if Form Section)
+
  
===Web/Mobile App===
+
And also calls the following [[:Category:Database_Triggers|database events and table triggers]]:
  
* None
+
* [[DBC_OPENDATA]] database event
 +
* [[ONOPEN Table Constraint|ONOPEN]] table trigger
 +
* [[DBC_BEFOREUPDATE]] database event
 +
* [[ONBEFOREUPDATE Table Constraint|ONBEFOREUPDATE]] table trigger
 +
* [[ONAFTERUPDATE Table Constraint|ONAFTERUPDATE]] table trigger
 +
* [[DBC_AFTERUPDATE]] database event
 +
* [[ONCLOSE Table Constraint|ONCLOSE]] table trigger
 +
* [[DBC_CLOSEDATA]] database event
 +
 
 +
[[Category:Custom Delegates]]

Latest revision as of 05:38, 30 July 2019

See Also

Custom Delegates, Database Triggers,

Opening and Closing

Opening an App

Desktop

When a Desktop App is opened, the following database events and table triggers are called:

And the following event delegates are called:

  • init
  • visiblewhen, enabledwhen (runtime only)
  • load
  • datachanged, parentdatachanged, refresh, afterrefresh
  • ready
  • resized (Canvas and Custom Sections)
  • activate

Setup.prg

If setup.prg exists in the App's directory, setup.prg is run.

INIT

  • App
    • Page1
      • Section1 (If Section1 has a 'database' value, the database is opened, running dbc_opendata.prg if it exists in the database's directory. If a database is open and Section1 has a 'table' value, the table is opened, running the table onopen trigger if one exists.)
        • Field1
        • Field2
        • FieldN
      • Section2 (Database and/or Section2's table as for Section1 above)
        • Field1 ... FieldN
      • SectionN (Database and/or SectionN's table as for Section1 above)
        • Field1 ... FieldN
    • Page2
      • Section1 (Database and/or Section1's table as for Page 1, Section1 above)
        • Field1 ... FieldN
      • Section2 (Database and/or Section2's table as for Page 1, Section1 above)
        • Field1 ... FieldN
      • SectionN (Database and/or SectionN's table as for Page 1, Section1 above)
        • Field1 ... FieldN
    • PageN
      • Section1 (Database and/or Section1's table as for Page 1, Section1 above)
        • Field1 ... FieldN
      • Section2 (Database and/or Section2's table as for Page 1, Section1 above)
        • Field1 ... FieldN
      • SectionN (Database and/or SectionN's table as for Page 1, Section1 above)
        • Field1 ... FieldN

VISIBLE WHEN

The VISIBLE WHEN event is called for Pages and their Sections (runtime only). Called after the object's init; other objects' init may not yet have been called.

ENABLED WHEN

The ENABLED WHEN event is called for Pages and their Sections (runtime only). Called after the object's init and visiblewhen; other objects' init and visiblewhen may not yet have been called.

LOAD

  • App
    • Page1
      • Section1
        • Field1 ... FieldN
      • ...
      • SectionN
        • Field1 ... FieldN
    • ...
    • PageN
      • Section1
        • Field1 ... FieldN
      • ...
      • SectionN
        • Field1 ... FieldN

DATACHANGED

The DATACHANGED event is called for data-bound Canvas Sections and Form Sections and their Fields.

PARENTDATACHANGED

The PARENTDATACHANGED event is called for related child Sections.

REFRESH

The REFRESH event is called for Sections.

AFTERREFRESH

The AFTERREFRESH event is called for Sections.

READY

  • App
    • Page1
      • Section1
        • Field1 ... FieldN
      • ...
      • SectionN
        • Field1 ... FieldN
    • ...
    • PageN
      • Section1
        • Field1 ... FieldN
      • ...
      • SectionN
        • Field1 ... FieldN

RESIZED

The RESIZED event is called for all Canvas and Custom Sections.

ACTIVATE

  • Page1 (or Page specified in the App 'Initial Page' attribute or first Page user has permission to read)
    • Section1
      • Field1 ... FieldN
    • ...
    • SectionN
      • Field1 ... FieldN

Web/Mobile App

When a Web/Mobile App is opened, the following database events and table triggers are called:

And the following event delegates are called:

  • init
  • load
  • datachanged, parentdatachanged, refresh, afterrefresh
  • ready
  • resized (Canvas and Custom Sections)
  • activate

INIT

  • App
    • Page1
      • FormSection1 Field1 ... FieldN
      • ...
    • Page2
      • FormSection1 Field1 ... FieldN
      • ...
    • ...
      • ...
    • PageN
      • FormSection1 Field1 ... FieldN
      • ...

LOAD

  • App
    • Page1
      • FormSection1 Field1 ... FieldN
      • ...
    • Page2
      • FormSection1 Field1 ... FieldN
      • ...
    • ...
      • ...
    • PageN
      • FormSection1 Field1 ... FieldN
      • ...

READY

  • App
    • Page1
      • FormSection1 Field1 ... FieldN
      • ...
    • Page2
      • FormSection1 Field1 ... FieldN
      • ...
    • ...
      • ...
    • PageN
      • FormSection1 Field1 ... FieldN
      • ...

DATACHANGED

The DATACHANGED event is called for data-bound Canvas Sections,Grid Sections and Form Sections.

PARENTDATACHANGED

The PARENTDATACHANGED event is called for related child Sections.

REFRESH

The REFRESH event is called for Sections.

AFTERREFRESH

The AFTERREFRESH event is called for Sections.

RESIZED

The RESIZED event is called for all Canvas and Custom Sections.

ACTIVATE

  • Page1 (or Page specified in the App 'Initial Page' attribute or first Page user has permission to read)

Closing an App

Desktop

When a Desktop App is closed, the following database events and table triggers are called:

And the following event delegates are called:

UNLOAD and DESTROY

  • Page1 UNLOAD
    • Section1 UNLOAD
    • ...
    • SectionN UNLOAD
  • Page1 DESTROY
    • Section1 DESTROY
    • ...
    • SectionN DESTROY
  • Page2 UNLOAD
    • Section1 UNLOAD
    • ...
    • SectionN UNLOAD
  • Page2 DESTROY
    • Section1 DESTROY
    • ...
    • SectionN DESTROY
  • ...
  • PageN UNLOAD
    • Section1 UNLOAD
    • ...
    • SectionN UNLOAD
  • PageN DESTROY
    • Section1 DESTROY
    • ...
    • SectionN DESTROY
  • App UNLOAD
  • App DESTROY

Web/Mobile App

When a Web/Mobile App is closed, the following database events and table triggers are called:

  • None

And the following event delegates are called:

  • None

Navigating

Navigating between Pages

When changing from one page (Page1) to another (Page2), the following event delegates are called:

Desktop

DEACTIVATE

  • Page1
    • Section1
      • Field1 ... FieldN
    • ...
    • SectionN
      • Field1 ... FieldN

RESIZED

  • Page2
    • Canvas or Custom Sections

DATACHANGED

  • Page 2
    • Data-bound Canvas Sections and Form Sections and their fields

PARENTDATACHANGED

  • Page2
    • Related child sections

REFRESH

  • Page 2
    • Section1
    • ...
    • SectionN

AFTERREFRESH

  • Page 2
    • Section1
    • ...
    • SectionN

ACTIVATE

  • Page2
    • Section1
      • Field1 ... FieldN
    • ...
    • SectionN
      • Field1 ... FieldN

VISIBLE WHEN and ENABLED WHEN

  • Page2 VISIBLE WHEN (runtime only)
  • Page2 ENABLED WHEN (runtime only)
    • Section1 VISIBLE WHEN (runtime only)
    • Section1 ENABLED WHEN (runtime only)
    • ...
    • SectionN VISIBLE WHEN (runtime desktop only)
    • SectionN ENABLED WHEN (runtime desktop only)

Web/Mobile App

DEACTIVATE

  • Page1

ACTIVATE

  • Page2

DATACHANGED

  • Page 2
    • Data-bound Canvas Sections, Form Sections and Grid Sections

PARENTDATACHANGED

  • Page2
    • Related child sections

RESIZED

  • Page2
    • Canvas or Custom Sections

REFRESH

  • Page 2
    • Section1
    • ...
    • SectionN

AFTERREFRESH

  • Page 2
    • Section1
    • ...
    • SectionN

Navigating Form Section

Desktop

Using Page actionbar or Section header actionbar

  • FormSection DATACHANGED
  • FormSection REFRESH and AFTERREFRESH
    • Field1 ... FieldN DATACHANGED
  • RelatedSection PARENTDATACHANGED
  • RelatedSection DATACHANGED (Canvas/Form Section)
  • RelatedSection REFRESH and AFTERREFRESH (Canvas/Form Section)
    • Field1 ... FieldN DATACHANGED (Form Section)
  • Page REFRESH and AFTERREFRESH

Web/Mobile App

Using Page actionbar

  • FormSection DATACHANGED
  • FormSection REFRESH and AFTERREFRESH
  • RelatedSection PARENTDATACHANGED
  • RelatedSection DATACHANGED
  • RelatedSection REFRESH and AFTERREFRESH

Navigating Grid Section

Desktop

From row to row (cursor or mouse) or using Page navigation buttons in the Grid Section actionbar

  • GridSection CLICK
  • RelatedSection PARENTDATACHANGED
  • RelatedSection DATACHANGED (Canvas/Form Section)
  • RelatedSection REFRESH and AFTERREFRESH (Canvas/Form Section)
    • Field1 ... FieldN DATACHANGED (Form Section)

Web/Mobile App

From row to row (mouse) or using Page navigation buttons in the Grid Section actionbar

  • GridSection CLICK
  • RelatedSection PARENTDATACHANGED
  • RelatedSection DATACHANGED
  • RelatedSection REFRESH and AFTERREFRESH

Data Operations

Adding a new record

Desktop

When adding a new record, the following events are called:

BEFORECREATE

  • Section

AFTERCREATE

  • Section

DATACHANGED

  • Field1 ... FieldN DATACHANGED

GOTFOCUS

  • Field1

INITFORMDEFAULTS

  • Section

REFRESH, AFTERREFRESH, DATACHANGED and PARENTDATACHANGED

  • RelatedSection PARENTDATACHANGED
  • RelatedSection DATACHANGED (Canvas/Form Section)
    • Field1 ... FieldN DATACHANGED (Form Section)
  • RelatedSection REFRESH and AFTERREFRESH (Canvas/Form Section)
  • Page REFRESH and AFTERREFRESH

Saving the newly added record calls the following database events and table triggers:

And the events as in Updating a record below.

If the 'Undo Change' button in the Page actionbar or the 'Revert' button in the Section actionbar is clicked, the events called are as in Deleting a record below.

Web/Mobile App

When a new record is saved, the following database events and table triggers are called:

And the events as in Updating a record below.

Updating a record

Desktop

Form Section

INTERACTIVECHANGE

The INTERACTIVECHANGE event is called on each entered keypress for editable fields.

HOTKEY

The HOTKEY event is called on non-entered keypresses for editable fields, e.g. Tab, Backspace.

VALIDATION

If specified, the VALIDATION Attribute expression is checked on exiting a modified field.

VALIDWHEN

Called after the save of a full Section edit, not an inline field edit.

  • Page
  • Section

BEFOREUPDATE

This and subsequent events are called after the save of a full Section or inline field edit.

  • Section

AFTERUPDATE

  • Section

REFRESH, AFTERREFRESH, DATACHANGED and PARENTDATACHANGED

  • Section REFRESH and AFTERREFRESH
  • Section DATACHANGED
    • Field1 ... FieldN DATACHANGED
  • RelatedSection PARENTDATACHANGED
  • RelatedSection DATACHANGED (Canvas/Form Section)
  • RelatedSection REFRESH and AFTERREFRESH (Canvas/Form Section)
    • Field1 ... FieldN DATACHANGED (Form Section)

Saving the updated record also calls the following database events and table triggers:

Canvas Section

MOUSEENTER

The MOUSEENTER event is called on editable fields.

GOTFOCUS

The GOTFOCUS event is called on editable fields.

CLICK

The CLICK event is called on editable fields.

INTERACTIVECHANGE

The INTERACTIVECHANGE event is called on each entered keypress for editable fields.

HOTKEY

The HOTKEY event is called on non-entered keypresses for editable fields, e.g. Tab, Backspace.

MOUSELEAVE

The MOUSELEAVE event is called on editable fields.

VALIDATION

If specified, the VALIDATION Attribute expression is checked for each modified field on exiting the field.

LOSTFOCUS

The LOSTFOCUS event is called on editable fields.

VALIDWHEN

  • Page
  • Section

BEFOREUPDATE

  • Section

AFTERUPDATE

  • Section

REFRESH, AFTERREFRESH, DATACHANGED and PARENTDATACHANGED

  • Section REFRESH and AFTERREFRESH
    • Field1 ... FieldN DATACHANGED
  • RelatedSection PARENTDATACHANGED
  • RelatedSection DATACHANGED (Canvas/Form Section)
  • RelatedSection REFRESH and AFTERREFRESH (Canvas/Form Section)
    • Field1 ... FieldN DATACHANGED (Form Section)

Saving the updated record also calls the following database events and table triggers:

Grid Section

VALIDATION

If specified, the VALIDATION Attribute expression is checked on exiting a modified cell.

The following events are called after clicking the Grid Section actionbar 'Save' button or moving to another grid row after modifying a Grid Section column.

VALIDWHEN

  • Section

BEFOREUPDATE

  • Section

AFTERUPDATE

  • Section

Changed

  • Section
  • Page

Saving the updated record also calls the following database events and table triggers:

Web/Mobile App

Form Section

GOTFOCUS

The GOTFOCUS event is called on editable fields.

INTERACTIVECHANGE

The INTERACTIVECHANGE event is called on each entered keypress for editable fields.

VALIDATION

If specified, the VALIDATION Attribute expression is checked on exiting a modified field.

CHANGED

The CHANGED event is called on modified fields.

LOSTFOCUS

The LOSTFOCUS event is called on editable fields.

After the save of a full Section or inline field edit:

BEFOREUPDATE

  • Section

AFTERUPDATE

  • Section

REFRESH, AFTERREFRESH, DATACHANGED and PARENTDATACHANGED

  • Section REFRESH and AFTERREFRESH
  • Section DATACHANGED
    • Field1 ... FieldN DATACHANGED
  • RelatedSection PARENTDATACHANGED
  • RelatedSection DATACHANGED
  • RelatedSection REFRESH and AFTERREFRESH

Saving the updated record also calls the following database events and table triggers:

Canvas Section

MOUSEENTER

The MOUSEENTER event is called on editable fields.

GOTFOCUS

The GOTFOCUS event is called on editable fields.

CLICK

The CLICK event is called on editable fields.

INTERACTIVECHANGE

The INTERACTIVECHANGE event is called on each entered keypress for editable fields.

CHANGED

The CHANGED event is called on modified fields.

LOSTFOCUS

The LOSTFOCUS event is called on editable fields.

MOUSELEAVE

The MOUSELEAVE event is called on editable fields.

After save is clicked:

BEFOREUPDATE

  • Section

AFTERUPDATE

  • Section

REFRESH, AFTERREFRESH, DATACHANGED and PARENTDATACHANGED

  • Section REFRESH and AFTERREFRESH
  • Section DATACHANGED
  • RelatedSection PARENTDATACHANGED
  • RelatedSection DATACHANGED
  • RelatedSection REFRESH and AFTERREFRESH

Saving the updated record also calls the following database events and table triggers:

Grid Section

The following events are called after editing and saving a Grid Section row in the 'Edit Record' dialog.

REFRESH, AFTERREFRESH, DATACHANGED and PARENTDATACHANGED

  • Section REFRESH and AFTERREFRESH
  • Section DATACHANGED
  • RelatedSection PARENTDATACHANGED
  • RelatedSection DATACHANGED
  • RelatedSection REFRESH and AFTERREFRESH

Saving the updated record also calls the following database events and table triggers:

Deleting a record

Desktop

When record deletion is confirmed, the following events are called:

BEFOREDELETE

  • Section

AFTERDELETE

  • Section

REFRESH, DATACHANGED and PARENTDATACHANGED

  • Section DATACHANGED
  • Section REFRESH and AFTERREFRESH
    • Field1 ... FieldN DATACHANGED
  • RelatedSection PARENTDATACHANGED
  • RelatedSection DATACHANGED (Canvas/Form Section)
  • RelatedSection REFRESH and AFTERREFRESH (Canvas/Form Section)
    • Field1 ... FieldN DATACHANGED (Form Section)

And also calls the following database events and table triggers:

Web/Mobile App

When deleting a record, the following events are called:

BEFOREDELETE

  • Section

and after record deletion is confirmed:

AFTERDELETE

  • Section

REFRESH, AFTERREFRESH, DATACHANGED and PARENTDATACHANGED

  • Section DATACHANGED
  • Section REFRESH and AFTERREFRESH
  • RelatedSection PARENTDATACHANGED
  • RelatedSection DATACHANGED
  • RelatedSection REFRESH and AFTERREFRESH

And also calls the following database events and table triggers: