Difference between revisions of "Event Delegate Sequences"

From Lianjapedia
Jump to: navigation, search
Line 282: Line 282:
 
'''HOTKEY'''
 
'''HOTKEY'''
  
The HOTKEY event is called for non-entered keypresses, e.g. Tab, Backspace.
+
The HOTKEY event is called for non-entered keypresses for editable fields, e.g. Tab, Backspace.
  
 
'''VALIDATION'''
 
'''VALIDATION'''

Revision as of 13:18, 3 March 2016

Under Construction

See Also

Custom Delegates

Opening and Closing

Opening an App

Desktop

When a Desktop App is opened, the following event delegates are called:

  • init
  • visiblewhen, enabledwhen (runtime only)
  • load
  • datachanged, parentdatachanged, refresh
  • ready
  • resized (Canvas Section)
  • 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 Form Sections and their Fields.

PARENTDATACHANGED

The PARENTDATACHANGED event is called for related child Sections.

REFRESH

The REFRESH 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 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 event delegates are called:

INIT

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

LOAD

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

READY

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

RESIZED

The RESIZED event is called for all Canvas 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 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

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

  • 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

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

Navigating Form Section

Desktop

Using Page actionbar or Section header actionbar

  • FormSection DATACHANGED
  • FormSection REFRESH
    • Field1 ... FieldN DATACHANGED
  • RelatedSection PARENTDATACHANGED
  • RelatedSection DATACHANGED (if Form Section)
  • RelatedSection REFRESH (if Form Section)
    • Field1 ... FieldN DATACHANGED (if Form Section)

Web/Mobile App

Using Page actionbar

  • None

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 (if Form Section)
  • RelatedSection REFRESH (if Form Section)
    • Field1 ... FieldN DATACHANGED (if Form Section)

Web/Mobile App

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

  • None

Data Operations

Adding a new record

Desktop

Web/Mobile App

Updating a record

Desktop

Form Section full Section edit:

INTERACTIVECHANGE

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

HOTKEY

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

VALIDATION

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

VALIDWHEN

  • Page
  • Section

BEFOREUPDATE

  • Section

ONBEFOREUPDATE

If it exists, the bound table's ONBEFOREUPDATE trigger is called.

ONAFTERUPDATE

If it exists, the bound table's ONAFTERUPDATE trigger is called.

AFTERUPDATE

  • Section

REFRESH, DATACHANGED and PARENTDATACHANGED

  • Section REFRESH
  • Section DATACHANGED
    • Field1 ... FieldN DATACHANGED
  • RelatedSection PARENTDATACHANGED
  • RelatedSection DATACHANGED (if Form Section)
  • RelatedSection REFRESH (if Form Section)
    • Field1 ... FieldN DATACHANGED (if Form Section)

Web/Mobile App

Deleting a record

Desktop

Web/Mobile App