new PropertyInfo(name, type[, flags][, getter][, setter])

Creates a new property definition.

The data type can be any one from the bo.dataTypes namespace or a custom data type based on DataType object, or can be any business object model or collection defined by the model types available in the bo namespace (i.e. models based on ModelBase or {@link bo.CollectionBase CollectionBase} objects).

The flags parameter is ignored when data type is a model or collection.

Parameters

Name Type Optional Description

name

string

 

The name of the property.

type

any type

 

The data type of the property.

flags

bo.shared.PropertyFlag

Yes

Other attributes of the property.

getter

external.propertyGetter

Yes

Custom function to read the value of the property.

setter

external.propertySetter

Yes

Custom function to write the value of the property.

Throws

Argument error: The name must be a non-empty string.

Argument error: The type must be a data type, a model or a collection.

Argument error: The flags must be PropertyFlag items.

Properties

read-only
getter  external.propertyGetter

The custom getter function of the property.

read-only
isKey  string

Indicates if the property is a key element.

read-only
isOnCto  string

Indicates whether the value of the property would be passed to the client or would be received from the client, respectively.

read-only
isOnDto  string

Indicates whether the value of the property would be passed to the data access object or would be received from the data access object, respectively.

read-only
isParentKey  string

Indicates if the property is a key element of the parent object.

read-only
isReadOnly  string

Indicates whether the value of the property can be modified.

read-only
name  string

The name of the property.

read-only
setter  external.propertySetter

The custom setter function of the property.

read-only
type  any type

The data type of the property.

The data type can be any one from the bo.dataTypes namespace or a custom data type based on DataType object, or can be any business object model or collection defined by the model types available in the bo namespace (i.e. models based on ModelBase or {@link bo.CollectionBase CollectionBase} objects).

Method

hasValue(value) → boolean

Checks if value has the appropriate type and it is not null, and not empty in case of Text data type.

Parameter

Name Type Optional Description

value

data

 

The value to check.

Returns

boolean True if the value is neither null nor empty, otherwise false.