$CurEntProperties

Set properties for an inner entity within the current occurrence of its parent entity.

$CurEntProperties(Entity {, Properties})

$CurEntProperties(Entity) = Properties

Example:  $CurEntProperties("LASTNAME") = "backcolor=lightgreen"

Parameters

Parameters
Parameter Data Type Description
Entity String Entity name; optional. The name may be fully qualified, for example, MYENT.MYMODEL.
Properties 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 current occurrence. Widget properties can be changed in the Uniface IDE, or using the $CurEntProperties 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 on the form, you will receive a compiler warning, but not a runtime error.

Use

Allowed in all component types.

Description

The $CurEntProperties function enables you to address the properties of an inner entity within a specific occurrence. The properties that can be addressed by $CurEntProperties depend on the target presentation platform, the component type, and the widget (if there is one).

Properties of the following widgets are supported:

Note:  There is no entity widget available for Static Server Pages and character-based components. In this case, properties set with $CurEntProperties are ignored.

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

$CurEntProperties 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.

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

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"    $CurEntProperties
  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

Version Change
9.5.01 Introduced

Related Topics