$entityproperties

Return or set the current representation properties of an entity.

$entityproperties {(Entity {, Properties} ) }

$entityproperties(Entity) = PropertiesList

Example: $EntityProperties("BOOK") = "backcolor=dodgerblue"

Parameters

Parameters
Parameter Data Type Description
Entity String Entity name; optional. The name may be fully qualified, for example, MYENT.MYMODEL.
Properties String Uniface list of properties for which the value should be returned
PropertiesList String Associative list of desired properties and their corresponding values, in the format:

Property = Value {;Propertyn = Valuen}

Return Values

  • Empty string ("") if an error occurred or if the default properties have not been changed.
  • Associative list containing the widget properties that have been changed from the default widget properties for the specified entity. Widget properties can be changed declaratively, or by the $entityproperties function itself.

Note:  If an error occurs, $procerror does not return a value to indicate the exact error. For example, if Entity does not exist in the component, you will receive a compiler warning, but not a runtime error.

Use

Allowed in all component types.

Description

The $entityproperties function enables you to control the appearance of all occurrences of the current entity at runtime. The entity properties that can be addressed by $entityproperties depend on the target presentation platform, the component type, and the widget (if there is one).

Properties of the following widgets are supported:

Note:  Entity properties cannot be set in Static Server Pages. In this case, properties set with $entityproperties are ignored.

For each property, Uniface looks for it in the property string returned by $entityproperties. If the property is not there, it is sought in the declarative properties, and finally in the .ini properties.

$entityproperties returns only properties that have been explicitly set, either by a previous ProcScript function, or declaratively in the Uniface IDE.

Each time that a component is restarted, these properties are reset to the compiled values, which are the default properties, plus the properties set for the entity declaratively. For more information, see Entity .

In Form components that have the Keep Data in Memory property selected, these properties are not reset.

Setting Grid Widget Properties

The following statement turns row headers and numbering off and makes field borders visible around each cell in the Grid.

operation exex
  ...
  $entityproperties = "RowHeadersVisible= F;RowNumbering = F;FieldBorders = T"
  edit
end; exec

Setting Entity Colors

The following example demonstrates the effect of setting entity properties using the $entityproperties and $CurEntProperties. In this case, an outer entity BOOK has an inner entity AUTHOR.

setocc "BOOK", 2  Make the second occurrence of BOOK the current
			 occurrence.
$EntityProperties("BOOK") = "backcolor=pink"      Set the color of all BOOK entities.
$CurEntProperties("AUTHOR") = "backcolor=lightgreen"    $entityproperties
  1.  Make the second occurrence of BOOK the current occurrence.
  2.  Set the color of all BOOK entities.
  3.  Set the color of the AUTHOR entity in the current occurrence to a different color
Result

Result: Inner entity of second occurrence is green

Related Topics