Appendices
Wizard execution tracking
A utility enabling tracking of execution logic of a wizard is available. To activate this, the HOPEX diagnostics window should be opened. This can be done using the following line of script:
currentEnvironment.site.toolkit.createMegaObject("Mapp.Diagnostics").open
In this window, the MetaWizard menu is available in the Monitor tab when a wizard is started in HOPEX. We must therefore start a wizard before selecting the menu.

This command opens a window displaying elements relating to execution of wizards.

Wizard button dynamic activation
In creation wizards, the name edit area is treated in a specific way: besides its positioning, outside the page area, the content of the area acts dynamically on activation of buttons OK or Finish, in particular when the name is not specified, or when the name is already assigned to another object; in this case, a message of explanation is displayed: "This object already exists".

However, default behavior of the wizard is such that other areas are only checked at a transition; the transition is refused if all areas have not been validated:
• all mandatory areas must be specified.
• all specified values must be valid.
Additional checks can be defined:
• by specifying a mandatory element in the properties page:
myItem = Item(...)...,Mandatory(True)
• or by implementing these in a trigger, in the OnWizBeforeTerminate function. This function being called when pressing the "Finish" button (or "OK" if there is only one page in the wizard), it enables prevention of validation of the wizard. It is compulsory in this case to inform the user, either by displaying a message box, or preferably by explicitly specifying the message area as follows:
In VBScript:
Page.Component.StatusMessage = "Message"
In Java : page.component().toMegaPropertyPageStandard().setStatusMessage("Message");
This check should not however be implemented in the WizPageCheck function when 'Previous' and 'Next' buttons are not active; this function being called at display of the page, the button cannot be reactivated and it will not be possible to terminate the wizard.
This behavior is functionally satisfactory, but you can arrange that behavior similar to that of the name area can be applied to other areas of the wizard, that is activation of buttons can evolve dynamically, according to modifications carried out in the page.
To do this, you must configure the page so as to activate instantaneous check; this can be done at initialization of the page, in the OnWizPageInitialize function.
VBScript :
Sub OnWizPageInitialize(Manager As MegaWizardContext,Page As MegaPropertyPage)
Page.Component.ActiveValidation = True
End Sub
Java :
public void OnWizPageInitialize(MegaWizardContext wctx,MegaPropertyPage mpp){
MegaPropertyPageStandard mpps = mpp.component().toMegaPropertyPageStandard();
mpps.setActiveValidation(true);
}
You can also activate customized checks by establishing a connection in the properties page; this connection enables a specific code to be activated on each user action in the page. This connection can also be activated at page initialization; in Java, the specific code is implemented via the interface
MegaPropertyPageStandard.PageConnectionPoint
mpp.connect(this); // the wizard class implements the PageConnectionPoint interface
The PageConnectionPoint interface comprises the function:
public void OnCommand(MegaPropertyPageStandard page, int notif, int control)
Notifications received depend on the elements contained in the page and are not the subject of a detailed description here. The example below enables tracking of events received in the connected pages:
public void OnCommand(MegaPropertyPageStandard page, int notif, int control) {
String itemName = page.currentControl().getProp("ItemName");
page.getRoot().print("OnCommand:" + itemName + " (" + notif + ")");
}
(To view displays controlled by the 'print' function activate tracking of macros by menu "Monitor>Mega Scripts Output" of the HOPEX diagnostics window mentioned above).