Modifying page behavior
Hiding a page
To condition appearance of a MetaPropertyPage, you can define a condition in the [Filter] paragraph of page configuration.
[Filter]
Condition = <condition>
The following example will hide the "Firm" page previously defined on a Department when the Department is not associated with a Firm.
The condition envisaged will relate to MetaAssociationEnd ~(hmSXaOYEryC[Firm]
You can relate the condition to the number of associated Firms by means of test ItemCount:
ItemCount(~(hmSXaOYEryC[Firm]) > 0
In the [Filter] section, you must specify:
[Filter]
Condition = ItemCount(~(hmSXaOYEryC[Firm]) > 0
Conditions can relate to attributes of the object, to attributes of connected objects, or to context data (for example user metamodel access).
To determine conditioning possibilities, you can be guided by _Parameterization text entry help (called by pressing keys <Ctrl>+<Space>, requesting online help (F1 on condition keyword in _Parameterization text) or by consulting the help section available at bottom of the page. A chapter in "HOPEX Forms" document is also dedicated to this subject.

Conditions on page elements
In the previous chapter we saw that it was possible to deactivate or hide an element. In particular, the keyword Visibility(Admin) enabled restriction of visibility to expert users: appearance of the page can therefore differ according to context.
This principle can be generalized: you can deactivate or hide elements and groups according to conditions explicitly defined in the page Template.
To do this, use keywords DisabledOn(condition) and HiddenOn(condition) after having defined a condition.
To illustrate conditioning, you shall specify that the "Is a Supervisor" attribute, visible in the Characteristics page of a Manager, will be activated when the Manager has Employees. The corresponding condition is declared in the page Template as follows:
HasEmployee=Condition(ItemCount(~demSW1OYEDCC[Employee]) > 0)
Simply cite this condition when redefining the ‘Is a Supervisor' element.
Supervisor=Item(~6emSr2OYEnKC[Is a Supervisor]),DisabledOn(HasEmployee)
If the condition is false (if the Manager has no employees), the element is deactivated.

Similarly, the element would be hidden if you apply the keyword HiddenOn(HasEmployee).
You can directly deactivate or hide complete content of a group by applying these keywords to a Group in the Template. We can test this possibility on the Details group previously defined in the ‘Manager' page.
Details=Group(Bar),Pos(Middle),Name(Details),HiddenOn(HasEmployee)
Redefining page template content
When content of a Properties page is highly dependent on specific characteristics of the object, definition of conditions can be complicated. To simplify this type of configuration, it is possible to extend Template content by means of an IncludeTemplate directive.
This directive initially enables inclusion in a Template paragraph of lines obtained from a text located on another object.
Extra=IncludeProfile(<objectId>),Text(<textid>),Paragraph(prgName)
If the keyword Text is not specified, the default text is _Parameterization.
If the keyword Paragraph is not specified, the default paragraph is ‘Template'
In this first use mode, <objectId> represents an explicit system object; this mode enables reuse of a configuration in several templates.
In more highly developed use modes, it is possible to calculate the system object to which the customization will relate.
Configuration depending on a system object connected to the current object
This object can for example be obtained by browsing a MetaAssociationEnd from the current object, which is indicated by the keyword Origin(Service)
ExtraParam=IncludeProfile(<AssociationEndId),Origin(Service),Paragraph(prgName:Template)
In particular, this device enables extension of an object page according to the _type of the object (_type being a system repository object).
Configuration depending on a MetaAttributeValue
Another possibility is to extend a page according to a particular value of MetaAttributeValue. In this case you must cite the MetaAttribute of the object and the keyword Origin(Value)
You can test this kind of extension on the Manager MetaClass.
You will first comment the MetaAttributeValues of the gender MetaAttribute, then define a template extension specific to the MetaAttributeValue in the _Parameterization text of the MetaAttributeValue, enabling display of its comment:
- For gender-F
[extension:Template]
helpgrp=Group(Bar),Pos(Bottom)
help=Item(~yhmSszNYEHuB[gender-F]),In(helpgrp),Control(HelpComment)
- For gender-M
[extension:Template]
helpgrp=Group(Bar),Pos(Bottom)
help=Item(~IgmSXzNYEzoB[gender-M]),In(helpgrp),Control(HelpComment)


Finally, we add the inclusion directive in the Manager.Properties MetaPropertyPage :
Help=IncludeProfile(~6emSkyNYETjB[gender]),Origin(Value),Paragraph(extension:Template)

The help section will appear at bottom of the page (since it is in a Pos(Bottom group)) and will depend on the gender MetaAttribute.
If the value is not defined, nothing will be inserted.
Note that this configuration is calculated from an effective value: to note the change, click Apply to validate gender modification.



Configuration calculated by macro
You can dynamically generate page content by means of a Macro.
ExtraParam=IncludeProfile(<MacroId>),Origin(Macro)
The macro should implement the InvokeOnObject function which should return a character string representing a "Template" paragraph.

In this way you can freely customize a Properties page, by making dependent the Template generated from the object supplied at input.