Uniface 10: Changes in Triggers
In Uniface 10, many triggers have been renamed to more accurately reflect their purpose or the event that they respond to.
Execute Trigger becomes Exec Operation
The Execute trigger of components was always treated as the default operation and exposed as the exec operation in the signature. In Uniface 10, this behavior is made explicit and the Execute trigger has become the exec operation, and is declared as such in the Script container:
operation exec public web ... end
In contrast, the Application Execute trigger of the application shell is a system trigger. It has been renamed to apStart:
trigger apStart ... end
Triggers
Triggers are now explicitly declared in an object's Script container using the trigger statement followed by the trigger name. In Uniface 9, only extended triggers were declared in this way.
Declaring a trigger in a derived object breaks inheritance, even if the trigger only contains non-executable code such as comments, spaces, or an entry.
Declaring such a trigger in an object that cannot inherit (supertype entity or field, modeled component, or a component that is not derived) disables the default behavior.
For triggers that have default behavior, as well as the exec operation, default behavior is enabled if either of the following conditions is true:
- The trigger is not declared in the local object, and not declared in the modeled object from which it might inherit.
- The trigger is declared without executable code
Trigger Names
The names of many triggers have been changed. The following table lists the old and new names of all triggers.
Uniface 9 Trigger Name | Uniface 10 Trigger Name | Object Type |
---|---|---|
<Accept> | accept | Component |
Add/Insert Occurrence | create | Entity (in Form) |
Application Execute | apStart | Application |
Asynchronous Interrupt | receiveMessage | Application, Component |
<Clear> | clear | Component (Form) |
Decrypt | formatFromDbms | Field |
Deformat | formatFromDisplay | Field |
Delete | delete | Entity |
Delete Up | deleteUp | Entity |
<Detail> | detail | Entity, Field |
Encrypt | formatToDbms | Field |
<Erase> | erase | Component (Form) |
Execute | operation exec | Component |
Field Gets Focus | getFocus | Field (in Form) |
Field Loses Focus | loseFocus | Field (in Form) |
Form Gets Focus | getFocus | Component (Form) |
Form Loses Focus | loseFocus | Component (Form) |
Format | formatToDisplay | Field |
Get State | preActivate | Component |
<Help> | help | Entity, Field (Form) |
Leave Modified Key | leaveModifiedKey | Entity (Form, Report) |
Leave Modified Occurrence | leaveModified | Entity (Form, Report) |
Leave Printed Occurrence | leavePrinted | Entity (Form, Report) |
Lock | lock | Entity |
<Menu> | menu | Application, Component, Entity, Field (Form) |
<Next Field> | next | Field (Form) |
Occurrence Gets Focus | getFocus | Header, footer, and break frame (Form, Report) |
On Error | error | Entity, Field |
Option | select | Menu item |
Pre Request | preRequest | Application |
Post Request | postRequest | Application |
Pre Load Occurrence | preDeserialize | Entity |
Post Load Occurrence | postDeserialize | Entity |
Pre Save Occurrence | preSerialize | Entity |
Post Save Occurrence | postSerialize | Entity |
Predisplay | preDisplay | Menu item |
<Previous Field> | previous | Field (in Form) |
<Print> | Component (Form) | |
<Pulldown> | pullDown | Application, Component (Form) |
<Quit> | quit | Component |
Read | read | Entity |
<Remove Occurrence> | remove | Entity (Form) |
<Retrieve> | retrieve | Component (Form) |
<Retrieve Sequential> | retrieveSequential | Component (Form) |
Set State | postActivate | Component |
Start Modification | startModification | Field (in Form) |
<Store> | store | Component (Form) |
Switch Keyboard | keyboardSwitch | Application |
User Key | userKey | Application |
Value Changed | valueChanged | Field (in Form) |
Validate | validate | Entity, Field |
Validate Key | validateKey | Entity |
Validate Occurrence | validate | Entity |
Write | write | Entity |
Write Up | writeUp | Entity |