uniface.Entity

The uniface.Entity object provides access to selected properties of the component entity that it represents. It is returned by the getEntities and getEntity functions of the uniface.Instance and uniface.Occurrence objects.

Functions

Data Addressing Functions

Function

Description

clearProperties() Restores the initial presentation properties of the Entity object.
clearProperty() Restores the initial value of the specified widget property.
getName() Returns the fully-qualified name of the Entity object in the form EntityName.ModelName.
getShortName() Returns the unqualified name of the current Entity object in the form EntityName.
getType() Returns a constant string denoting the object type: Entity
getParent() Returns an API object that represents the parent of the current Entity object; either a uniface.Instance object (if the Entity object represents the outermost entity in a component instance) or an Occurrence object (if the Entity object represents an inner entity).
getInstance() Returns the uniface.Instance in which the Entity object resides.
getOccurrenceCount() Returns the number of occurrences that are present in the Entity object.
getOccurrences() Returns an array with the uniface.Occurrence objects that represent the Entity object's occurrences.
getOccurrence() Returns the nth occurrence of the Entity object.
getProperties() Returns the properties of this Entity object
getProperty() Returns the value of a property of this Entity object
isEqualTo()

Checks whether the Entity object is the same as another Entity object.

setProperties() Sets one or more widget properties for the Entity object.
setProperty() Sets the specified widget property for the Entity object to a given value.
Occurrence API Functions

Function

Description

clear() Removes all occurrences of the Entity object on the client.
createOccurrence() Creates a new Occurrence object with the specified index.

Example: JavaScript Data Addressing API

var vInstance = uniface.getInstance("MUSICLIST");
if (vInstance != null) {
  var vEntity = vInstance.getEntity("ITEMS.MUSICSHOP");
  if (vEntity != null) {
     var vOccs = vEntity.getOccurrences();
     for (var i =  0; i < vOccs.length; i++) {
	doSomethingWithOccurrence(vOccs[i]);
     }
     var vOcc = vEntity.getOccurrence(4);
     if (vOcc) {
        alert (vOcc + " has status " + vOcc.getStatus());
     }
  }
}

Related Topics