Master Action Defaults file is an .ad2 file that contains default attributes (texts, images, accelerators, etc.) for actions that can be performed in the 4GL application. Master Action Defaults files have the name of the program, are stored together with it, and are loaded automatically when the application is run.
Application Action Defaults file is a user-defined configuration file with extension .ad2 or .fm2 that contains default attributes for actions that can be performed in several different 4GL applications in order to secure their common runtime behavior or change it according to current tasks and purposes.
Differences between Master and Application Action Defaults files are summed up in the table below.
|
|
Master Action Defaults file |
Application Action Defaults file |
|
has the same name as the 4GL program |
|
|
|
must be stored in the same folder as the program executable file |
|
|
|
is loaded automatically when the application is run |
|
|
|
is applied at runtime |
|
|
In their essence, Master and Application Action Defaults files are the same type of files and have the same syntax and structure.
What differs is their purpose, location, and loading time.
Below you can see two example of an Action Defaults file that can serve both as Master and Application one:
#1
<?xml version="1.0" encoding="UTF-8"?>
<form xmlns="http://namespaces.querix.com/2015/fglForms" title="ActionDefaults">
<form.actions>
<Action identifier="accept" text="Action One" validate="true" defaultView="Auto" statical="true" accelerator1="A,true,false,true" actionImage="qx://application/accept.png"/>
<Action identifier="cancel" text="Action Two" validate="true" defaultView="Auto" statical="true" accelerator1="C,true,false,true" actionImage="qx://application/cancel.png"/>
</form.actions>
</form>
#2
<?xml version="1.0" encoding="UTF-8"?>
<form xmlns="http://namespaces.querix.com/2015/fglForms" title="ActionDefaults">
<form.actions>
<Action identifier="act_1" text="Action One" validate="true" defaultView="Auto" statical="true" accelerator1="A,true,false,true" actionImage="qx://application/accept.png"/>
<Action identifier="act_2" text="Action Two" validate="true" defaultView="Auto" statical="true" accelerator1="C,true,false,true" actionImage="qx://application/cancel.png"/>
</form.actions>
</form>
Usually, Master Action Defaults files are created together with 4GL programs.
To create a Master Action Defaults file, do the following:
Step 1. Right-click your program in FGL Project Explorer.
Step 2. In the dialog that appears, select the Create New... option, and next - the New Action Defaults File one.
Step 3. Specify the name of the file, and press Enter.
By default, your Master Action Defaults file will be empty.
Master Action Defaults files are edited in the same way as any other .ad2 files:
If you want to edit your Master Action Defaults files as the XML code, we recommend you first to study these topics:
Application Action Defaults files are more flexible than Master ones in terms of their creation, storage, and usage.
Application Action Defaults files can have two extensions - .ad2 or .fm2.
Attention: All the file names you use in your 4GL development must be platform-independent.
If you use platform-dependent names (for example, combine upper and lower case, use colons, finish names with a full stop, etc.), please remember that they might cause different problems when you move your project to another platform.
Regardless of their extension, Application Action Defaults files can be edited in Lycia Form Builder or in code editor.
Before you start editing your Application Action Defaults files as the XML code, we recommend you to study these topics:
Application Action Defaults files can be stored in any necessary location:
Contrary to Master Action Defaults files, the Application Action Defaults files must be loaded from your 4GL code - by ui.Interface.loadActionDefaults():
CALL ui.Interface.loadActionDefaults("my_ads_yes_no")
The same Application Action Defaults file can be used with as many 4GL applications as you need once they are called properly.