Class: DataPortalContext

bo.shared. DataPortalContext

Provides the context for custom data portal actions.

new DataPortalContext(dao, properties, getValue, setValue)

Creates a new data context object.

Warning: Data context objects are created in models internally. They are intended only to make publicly available the context for custom data portal actions.

Parameters:
Name Type Argument Description
dao object

The data access object of the current model.

properties Array.<bo.shared.PropertyInfo>

An array of property definitions.

getValue internal~getValue <optional>

A function that returns the current value of a property.

setValue internal~setValue <optional>

A function that changes the current value of a property.

Throws:
  • Argument error: The dao argument must be an object.
  • Argument error: The properties must be an array of PropertyInfo objects, or a single PropertyInfo object or null.
  • Argument error: The getValue argument must be a function.
  • Argument error: The setValue argument must be a function.

Members

<readonly> connection :object

The connection object for the data source.

Type:
  • object

<readonly> dao :object

The data access object of the current model.

Type:
  • object

<readonly> isSelfDirty :boolean

Indicates whether the current model itself has been changed.

Type:
  • boolean

<readonly> locale :string

The current locale.

Type:
  • string

<readonly> properties :Array.<bo.shared.PropertyInfo>

Array of property definitions that may appear on the data transfer object.

Type:

<readonly> user :bo.system.UserInfo

The current user.

Type:

Methods

getValue(propertyName) → {*}

Gets the current value of a model property.

Parameters:
Name Type Description
propertyName string

The name of the property.

Throws:
Returns:

The value of the model property.

Type
*

setState(connection, isSelfDirty) → {bo.shared.DataPortalContext}

Sets the current state of the model.

Parameters:
Name Type Argument Description
connection object <optional>

The current connection for the data store.

isSelfDirty boolean <optional>

Indicates whether the current model itself has been changed.

Returns:

The data context object itself.

Type
bo.shared.DataPortalContext

setValue(propertyName, value)

Sets the current value of a model property.

Parameters:
Name Type Description
propertyName string

The name of the property.

value *

The new value of the property.

Throws:
If you find bugs or have feature requests, please let us know.

JavaScript business objects ♦ Copyright © 2014-2016 Logikum, Ltd.
Documentation generated by JSDoc 3.2.2 on 2015. December 31. using the DocStrap template.