Skip to main content
Pentaho Documentation

View

pentaho.visual.base. View

This is the base class for views of visualizations.

A container is expected to instantiate a View given a specification with its main properties, like the container DOM element, the width, height and model. The model may not be immediately valid. Alternatively, the container DOM element can be set at a later time, using pentaho.visual.base.View#domContainer.

In any case, the first rendering of the view must be explicitly triggered by a call to update. This two-phase process allows a container application to further configure a view, for example, registering event listeners, before the initial update.

Over time, the view's model is mutated and, in response, the view detects these changes, marks itself as dirty, and, by default, automatically updates itself.

In response to the user interacting with the view, it may perform actions, such as the standard actions Select and Execute, and emit events for these. Note that standard actions come pre-loaded with the View class, and can thus be safely constructed synchronously from View derived classes.

All registered visual filter types are pre-loaded and can be safely loaded synchronously.

When a view is no longer needed, the container application must call its dispose method, so that the view can free held resources and not cause memory-leaks.

AMD Module

require(["pentaho/visual/base/View"], function(View) { /* code goes here */ });

See also: pentaho.visual.base.spec.IView , pentaho.visual.base.spec.IViewType , pentaho.visual.action.Select , pentaho.visual.action.Execute

Extends

Implements

Constructor

Name Description
new View(viewSpec)
Abstract

Creates a visualization View instance.

Members

Name Description
PropertyGroups : number
Static

The PropertyGroups enumeration contains the entries for the distinct groups of properties that the base View class recognizes when categorizing property changes.

$changeset : pentaho.type.changes.Changeset

Gets the changeset of this instance in the ambient transaction, if any, or null.

$hasChanges : boolean

Gets a value that indicates if this instance has any changes in the ambient transaction.

$isValid : boolean

Determines if this value is a valid.

$key : string

Gets the key of the complex value.

$references : Array.<Object>

Gets the references to this container, or null, if none.

$type : pentaho.type.ValueType

Gets the type of this instance.

$uid : string

Gets the unique identifier of the instance.

$version : number

Gets the current version of the instance.

base : function
Protected

If a method has been overridden, then the base method provides access to the overridden method.

domContainer : DOMElement

Gets or sets the container DOM element where the view is rendered.

height : number

Gets or sets the height that the container application has allocated to display the view without horizontal or vertical scrolling, in pixels.

isAutoUpdate : boolean

Gets or sets a value that enables or disables automatic updates of the view.

isDirty : boolean

Gets a value that indicates if the view is in a dirty state.

isUpdating : boolean

Gets a value that indicates if an update is in progress.

model : pentaho.visual.base.Model

Gets or sets the visualization model.

selectionFilter : pentaho.data.filter.Abstract

Gets or sets the current data selection filter.

width : number

Gets or sets the width that the container application has allocated to display the view without horizontal or vertical scrolling, in pixels.

Methods

Name Description
_subclassed()
Static
createAsync(viewSpec) : Promise.<pentaho.visual.base.View>
Static

Creates a view, asynchronously, given its specification.

getClassAsync(modelType) : Promise.<Class.<pentaho.visual.base.View>>
Static

Gets a promise for the view class (constructor), of the registered default type, if any, for the given model type or identifier.

_compare(other) : number
Protected

Compares this element to a distinct, non-equal element of the same type according to its relative order.

_configure(config)
Protected

Configures this value with a given distinct and non-Nully configuration.

_configureOrCreate(config) : pentaho.type.Element
Protected

Configures this value with a given distinct and non-Nully configuration, if it is possible. Otherwise creates and returns a new value based on this one, but with the configuration applied.

_configureProperty(propType, valueConfig)
Protected

Configures a property with a given value specification.

_createActionExecution(action) : pentaho.type.action.Execution
Protected

Creates an action execution for a given action.

_createChangeset(transaction) : pentaho.type.changes.Changeset
Protected

Creates a changeset with this container as owner and returns it.

_createGenericActionExecution(action) : pentaho.type.action.Execution
Protected

Creates a generic action execution for a given action.

_emit(event) : pentaho.lang.Event
Protected

Emits an unstructured event and returns it, unless it was canceled.

_emitActionPhaseDoEvent(actionExecution) : Promise
Protected

Emits the do phase event of an action execution.

_emitActionPhaseFinallyEvent(actionExecution)
Protected

Emits the finally phase event of an action execution.

_emitActionPhaseInitEvent(actionExecution)
Protected

Emits the init phase event of an action execution.

_emitActionPhaseWillEvent(actionExecution)
Protected

Emits the will phase event of an action execution.

_emitGeneric(source, eventArgs, type, phase, keyArgs) : boolean
Protected

Emits an event given an arbitrary payload object, its type and phase. Returns the event payload object, unless the event is canceled.

_emitGenericAllAsync(source, eventArgs, type, phase, keyArgs) : Promise.<object>
Protected

Emits an event asynchronously, given an arbitrary payload object, its type and phase, and succeeding if every listener succeeds.

_emitSafe(event) : pentaho.lang.Event
Protected

Variation of the _emit method in which errors thrown by event listeners are caught and logged.

_equals(other) : boolean
Protected

Gets a value that indicates if a given distinct, non-null value of the same type represents the same entity.

_hasListeners(type, phase) : boolean
Protected

Determines if there are any registrations for a given event type and, optionally, phase.

_init(viewSpec)
Protected

Called when the view is constructed.

_initClone(clone)
Protected

Initializes a shallow clone of this container.

_initContainer()
Protected

Initializes a container instance.

_initDomContainer()
Protected

Called to initialize the DOM container, when it is set.

_initProperties(spec)
Protected

Initializes the properties of the complex instance from a the given specification.

_onChangeClassify(dirtyPropGroups, changeset)
Protected

Called when the view properties have changed.

_onChangeDid(changeset)
Protected

Called after a changeset has been committed.

_onChangeDirty(dirtyPropGroups)
Protected

Called when a change caused relevant property groups to be marked as dirty.

_onChangeRejected(changeset, reason)
Protected

Called after a changeset has been rejected.

_onChangeWill(changeset, keyArgs) : pentaho.lang.UserError
Protected

Called before a changeset is committed.

_onUpdateDo(updateActionExecution) : Promise
Protected

Performs the do phase of an update action execution.

_onUpdateFinally(updateActionExecution)
Protected

Performs the finally phase of an update action execution.

_onUpdateInit(updateActionExecution)
Protected

Performs the init phase of an update action execution.

_onUpdateWill(updateActionExecution)
Protected

Performs the will phase of an update action execution.

_releaseDomContainer()
Protected

Called to release any references to the DOM container.

_updateAll()
Protected

Fully renders or updates the view.

_updateData()
Protected

Updates the view, taking into account that only the data-related model properties have changed.

_updateGeneral()
Protected

Updates the view, taking into account that only "general" model properties have changed.

_updateSelection()
Protected

Updates the view, taking into account that only the selection-related model properties have changed.

_updateSize()
Protected

Updates the view, taking into account that only the dimensions of the view have changed.

act(action) : pentaho.type.action.Execution

Executes or starts execution of a given action in this target and returns the corresponding action execution instance.

actAsync(action) : Promise

Executes a given action with this view as its target and waits for its outcome.

assertValid()

Ensures that the value is valid, and throws the first validation error if it is not.

clone() : pentaho.type.Value
Abstract

Creates a shallow clone of this value.

compare(other) : number

Compares this element to another according to its relative order.

configure(config)

Configures this value with a given configuration.

configureOrCreate(config) : pentaho.type.Element

Configures this value with a given configuration, if it is possible. Otherwise creates and returns a new value based on this one, but with the configuration applied.

countOf(name, sloppy) : number

Gets the number of values of a given property.

countRangeOf(name) : pentaho.IRange

Gets the current valid count range of values of a given property.

dispose()

Disposes the view by freeing external resources held by the view.

domainOf(name) : Array.<pentaho.type.Element>

Gets the current list of valid values of a given property.

equals(other) : boolean

Determines if a given value represents the same entity.

equalsContent(other) : boolean

Gets a value that indicates if a given equal value has the same content as this one.

extend(source, keyArgs) : Object

Extend an object with the properties of another.

get(name, sloppy) : pentaho.type.Value | Nully

Gets the value of a property.

getf(name, sloppy) : string

Gets the string representation of the value of a property.

getv(name, sloppy) : any | pentaho.type.Complex | pentaho.type.List | Nully

Gets the primitive value of the value of a property.

isApplicableOf(name) : boolean

Gets a value that indicates if a given property is currently applicable.

isDefaultedOf(name) : boolean

Gets a value that indicates if a given property has assumed a default value.

isEnabledOf(name) : boolean

Gets a value that indicates if a given property is currently enabled.

isRequiredOf(name) : boolean

Gets a value that indicates if a given property is currently required.

off(typeOrHandle, observer)

Removes one registration given its handle, or all registrations of a given event type (or types) and observer (or listener function).

on(type, observer, keyArgs) : pentaho.lang.IEventRegistrationHandle

Registers an observer (or listener function) for an event(s) of a given type(s).

set(name, valueSpec)

Sets the value of a property.

toJSON() : JsonValue

Creates a top-level JSON specification that describes this instance.

toSpec(keyArgs) : pentaho.type.spec.Instance

Creates a specification that describes this value.

toSpecInContext(keyArgs) : any

Creates a specification that describes this instance.

update() : Promise

Updates the view to match its latest state.

validate() : Array.<pentaho.type.ValidationError>

Determines if this value is valid.

Constructor Details

new View(viewSpec)
Abstract

Creates a visualization View instance.

Source: javascript/web/pentaho/visual/base/View.js, line 208

Parameters:
Name Default Value Summary
viewSpec : pentaho.visual.base.spec.IViewEx
Optional

The extended view specification.

See also: pentaho.visual.base.spec.IView , pentaho.visual.base.spec.IViewType , pentaho.visual.action.Select , pentaho.visual.action.Execute

Members Details

PropertyGroups: number
Static

The PropertyGroups enumeration contains the entries for the distinct groups of properties that the base View class recognizes when categorizing property changes.

Properties:
Name Default Value Description
All : number ~0

Includes all view and model properties.

Ignored : number 0

The group of properties whose changes are ignored, because the view does not visually represent these in any way.

General : number 1

The group of properties that don't have a more specific property group.

Data : number 2

The group of data-related properties.

By default, the only property of this group is the model's data property.

Size : number 4

The group of size-related properties.

By default, the properties of this group are the view's width and height properties.

Selection : number 8

The group of selection-related properties.

By default, the only property of this group is the model's selectionFilter property.

Source: javascript/web/pentaho/visual/base/View.js, line 1140

See also: pentaho.visual.base.View#_onChangeClassify

$changeset: pentaho.type.changes.Changeset

Gets the changeset of this instance in the ambient transaction, if any, or null.

Source: javascript/web/pentaho/type/mixins/Container.js, line 194

Inherited From: pentaho.type.mixins.Container#$changeset

$hasChanges: boolean

Gets a value that indicates if this instance has any changes in the ambient transaction.

Source: javascript/web/pentaho/type/mixins/Container.js, line 204

Inherited From: pentaho.type.mixins.Container#$hasChanges

$isValid: boolean

Determines if this value is a valid.

This attribute calls validate and returns a boolean value indicating if it returned no errors.

Source: javascript/web/pentaho/type/Value.js, line 168

Inherited From: pentaho.type.Value#$isValid

$key: string

Gets the key of the complex value.

The default complex implementation returns the value of the $uid property.

Source: javascript/web/pentaho/type/Complex.js, line 188

Inherited From: pentaho.type.Complex#$key

$references: Array.<Object>

Gets the references to this container, or null, if none.

Note that the returned array may be empty.

Do NOT change the returned array or its elements in any way.

Source: javascript/web/pentaho/type/mixins/Container.js, line 137

Inherited From: pentaho.type.mixins.Container#$references

$type: pentaho.type.ValueType

Gets the type of this instance.

Source: javascript/web/pentaho/type/Value.js, line 334

Overrides: pentaho.type.Complex#$type

$uid: string

Gets the unique identifier of the instance.

Source: javascript/web/pentaho/type/mixins/Container.js, line 56

Inherited From: pentaho.type.mixins.Container#$uid

$version: number

Gets the current version of the instance.

Source: javascript/web/pentaho/type/mixins/Container.js, line 168

Inherited From: pentaho.type.mixins.Container#$version

base: function
Protected

If a method has been overridden, then the base method provides access to the overridden method.

Can also be called from within a constructor function.

Source: javascript/web/pentaho/lang/Base.js, line 299

Inherited From: pentaho.lang.Base#base

domContainer: DOMElement

Gets or sets the container DOM element where the view is rendered.

The container element is the viewport through which the view's rendered content is revealed. and is provided empty, for the exclusive use of the view, by the container application.

Its content is owned by the view, but its attributes (including style) are owned by the container application and must not be changed by the view.

Its size is controlled by the container application and does not need to be the same as that implied by the visual model's width and height properties, however, normally, it will.

It is the responsibility of the container application to clean up the container element's content, if needed, after the view is disposed of. When disposed of, the view has the responsibility of cleaning up any DOM event handlers it may hold on the container element or any of its children.

Source: javascript/web/pentaho/visual/base/View.js, line 310

See also: pentaho.visual.base.View#_initDomContainer , pentaho.visual.base.View#_releaseDomContainer

height: number

Gets or sets the height that the container application has allocated to display the view without horizontal or vertical scrolling, in pixels.

This property is required.

Source: javascript/web/pentaho/visual/base/View.js, line 888

isAutoUpdate: boolean

Gets or sets a value that enables or disables automatic updates of the view.

When true, the view is automatically updated whenever a relevant change in the model occurs. When false, the view must be manually updated by calling update.

Setting this property to true does not cause the view to update in response, if it is currently dirty. This property only affects the view's behaviour in response to subsequent model changes.

Source: javascript/web/pentaho/visual/base/View.js, line 377

isDirty: boolean

Gets a value that indicates if the view is in a dirty state.

A view is dirty during the period after the view's model has changed to until the time the view is updated.

During this period, the view should not handle any user interaction events, as the user would be acting on an outdated representation of the model.

Source: javascript/web/pentaho/visual/base/View.js, line 411

See also: pentaho.visual.base.View#isAutoUpdate

isUpdating: boolean

Gets a value that indicates if an update is in progress.

Source: javascript/web/pentaho/visual/base/View.js, line 394

See also: pentaho.visual.base.View#update

model: pentaho.visual.base.Model

Gets or sets the visualization model.

This property is required.

Source: javascript/web/pentaho/visual/base/View.js, line 903

selectionFilter: pentaho.data.filter.Abstract

Gets or sets the current data selection filter.

This property is required.

By default, this property is not included when serializing to JSON. To serialize it, specify the argument keyArgs.omitProps.selectionFilter of toSpec to false.

When set to a filter specification, pentaho.data.filter.spec.IAbstract, it is converted into a filter object. Any standard filter can be safely loaded synchronously.

ATTENTION: The current implementation only supports filters that can be converted to DNF in a reasonable amount of time.

Source: javascript/web/pentaho/visual/base/AbstractModel.js, line 290

width: number

Gets or sets the width that the container application has allocated to display the view without horizontal or vertical scrolling, in pixels.

This property is required.

Source: javascript/web/pentaho/visual/base/View.js, line 873

Methods Details

_subclassed()
Static

Source: javascript/web/pentaho/visual/base/View.js, line 1117

createAsync(viewSpec) : Promise.<pentaho.visual.base.View>
Static

Creates a view, asynchronously, given its specification.

If the view specification has its type annotated inline, a view of that type is built.

Otherwise, when the view type is not annotated inline in the specification, if its model property is specified with an already instantiated model instance, or with a type annotated specification, that model's type's default view class is used to create a view instance from the given specification. The returned promise is rejected if the provided model specification is not specified or is not type annotated. The returned promise is also rejected if the model type has no registered default view type.

Unlike the pentaho.type.Type#createAsync counterpart method, this static variant can be called to create an instance of any view type, even if it isn't a subtype of this one.

Source: javascript/web/pentaho/visual/base/View.js, line 1050

Parameters:
Name Default Value Summary
viewSpec : pentaho.visual.base.spec.IViewEx

The extended view specification.

Returns:
Name Description
Promise.<pentaho.visual.base.View>

A promise for a view with the given specification.

getClassAsync(modelType) : Promise.<Class.<pentaho.visual.base.View>>
Static

Gets a promise for the view class (constructor), of the registered default type, if any, for the given model type or identifier.

Source: javascript/web/pentaho/visual/base/View.js, line 1099

Parameters:
Name Default Value Summary
modelType : string | pentaho.visual.base.ModelType

The visual model type or its identifier.

Returns:
Name Description
Promise.<Class.<pentaho.visual.base.View>>

A promise for a view class of the given model type.

_compare(other) : number
Protected

Compares this element to a distinct, non-equal element of the same type according to its relative order.

The default implementation does a lexicographical comparison of the elements' keys.

Source: javascript/web/pentaho/type/Element.js, line 105

Inherited From: pentaho.type.Element#_compare

Parameters:
Name Default Value Summary
other : pentaho.type.Element

The other element value.

Returns:
Name Description
number

-1 if this value is before other; 1 if this value is after other; 0, otherwise.

See also: pentaho.type.Element#compare , pentaho.type.Value#equals

_configure(config)
Protected

Configures this value with a given distinct and non-Nully configuration.

This method can only be called when there is an ambient transaction.

The default implementation throws an error if this value's type is read-only.

Source: javascript/web/pentaho/type/Value.js, line 264

Inherited From: pentaho.type.Value#_configure

Parameters:
Name Default Value Summary
config : any

The distinct, non-Nully configuration.

Throws:
Name Description
TypeError

When the value would be changed and its type is read-only.

See also: pentaho.type.Value#configure , pentaho.type.Complex#_configure , pentaho.type.List#_configure

_configureOrCreate(config) : pentaho.type.Element
Protected

Configures this value with a given distinct and non-Nully configuration, if it is possible. Otherwise creates and returns a new value based on this one, but with the configuration applied.

This method can only be called when there is an ambient transaction.

Source: javascript/web/pentaho/type/Element.js, line 175

Inherited From: pentaho.type.Element#_configureOrCreate

Parameters:
Name Default Value Summary
config : any

The non-Nully configuration. Assumed distinct from this.

Returns:
Name Description
pentaho.type.Element

this, already configured, or a new value.

See also: pentaho.type.Element#configureOrCreate , pentaho.type.Value#configure

_configureProperty(propType, valueConfig)
Protected

Configures a property with a given value specification.

Execution proceeds as follows:

  1. If the property is a list property:

    1. If the config value is null, the list is cleared by calling the List#clear method;
    2. Otherwise, if the config value is distinct from the current list value, execution is delegated to the List.configure method;
  2. If the property is an element property:

    1. If either the current value or the config value are null, then the config value replaces the current value;
    2. Otherwise, execution is delegated to the Element#configureOrCreate method; if it returns an element distinct from the current value, then that value replaces the current value.

If in any of the described steps, an error is thrown if a change would result to the property's value and the property is read-only. Also, an error is thrown if the value itself would have to be mutated and its type is read-only.

Source: javascript/web/pentaho/type/Complex.js, line 487

Inherited From: pentaho.type.Complex#_configureProperty

Parameters:
Name Default Value Summary
propType : pentaho.type.PropertyType

The property to configure.

valueConfig : any

A value specification. Not undefined.

Throws:
Name Description
TypeError

When the property value would be replaced or, in case of list properties, its elements would be added, moved or removed and the property is read-only.

TypeError

When the property's current value would be mutated and its type is read-only.

_createActionExecution(action) : pentaho.type.action.Execution
Protected

Creates an action execution for a given action.

The default implementation delegates to [_createGenericActionExecution]{pentaho.type.action.impl.Target#_createGenericActionExecution}.

Source: javascript/web/pentaho/type/action/impl/Target.js, line 156

Overrides: pentaho.type.action.impl.Target#_createActionExecution

Parameters:
Name Default Value Summary
action : pentaho.type.action.Base

The action which will be executed.

Returns:
Name Description
pentaho.type.action.Execution

The action execution.

See also: pentaho.type.action.ITarget#act

_createChangeset(transaction) : pentaho.type.changes.Changeset
Protected

Creates a changeset with this container as owner and returns it.

Source: javascript/web/pentaho/type/mixins/Container.js, line 229

Inherited From: pentaho.type.mixins.Container#_createChangeset

Parameters:
Name Default Value Summary
transaction : pentaho.type.changes.Transaction

The transaction that owns this changeset.

Returns:
Name Description
pentaho.type.changes.Changeset

A changeset of the appropriate type.

_createGenericActionExecution(action) : pentaho.type.action.Execution
Protected

Creates a generic action execution for a given action.

The implementation returns an instance of Target.GenericActionExecution.

Source: javascript/web/pentaho/type/action/impl/Target.js, line 172

Inherited From: pentaho.type.action.impl.Target#_createGenericActionExecution

Parameters:
Name Default Value Summary
action : pentaho.type.action.Base

The action which will be executed.

Returns:
Name Description
pentaho.type.action.Execution

The action execution.

_emit(event) : pentaho.lang.Event
Protected

Emits an unstructured event and returns it, unless it was canceled.

When this method is called, the listeners of existing registrations are notified synchronously, by priority order and then registration order, until either the event is canceled or all of the listeners have been notified.

It is safe to register or unregister to/from an event type while it is being emitted. However, changes are only taken into account in subsequent emissions.

If a listener function throws an error, the event processing is interrupted. No more registrations are processed and the error is passed to the caller.

Source: javascript/web/pentaho/lang/EventSource.js, line 269

Overrides: pentaho.type.action.impl.Target#_emit

Parameters:
Name Default Value Summary
event : pentaho.lang.Event

The event object.

Returns:
Name Description
pentaho.lang.Event | null

The given event object or null, when canceled.

See also: pentaho.lang.EventSource#_emitSafe , pentaho.lang.EventSource#_emitGeneric

_emitActionPhaseDoEvent(actionExecution) : Promise
Protected

Emits the do phase event of an action execution.

The default implementation delegates to _emitGenericAllAsync, when the action is asynchronous. Delegates to _emitGeneric, otherwise.

Source: javascript/web/pentaho/type/action/impl/Target.js, line 230

Inherited From: pentaho.type.action.impl.Target#_emitActionPhaseDoEvent

Parameters:
Name Default Value Summary
actionExecution : pentaho.type.action.Execution

The action execution.

Returns:
Name Description
Promise | null

A promise to the completion of the asynchronous do listener, of an asynchronous action, or null.

_emitActionPhaseFinallyEvent(actionExecution)
Protected

Emits the finally phase event of an action execution.

The default implementation delegates to _emitGeneric.

Source: javascript/web/pentaho/type/action/impl/Target.js, line 254

Inherited From: pentaho.type.action.impl.Target#_emitActionPhaseFinallyEvent

Parameters:
Name Default Value Summary
actionExecution : pentaho.type.action.Execution

The action execution.

_emitActionPhaseInitEvent(actionExecution)
Protected

Emits the init phase event of an action execution.

The default implementation delegates to _emitGeneric.

Source: javascript/web/pentaho/type/action/impl/Target.js, line 188

Inherited From: pentaho.type.action.impl.Target#_emitActionPhaseInitEvent

Parameters:
Name Default Value Summary
actionExecution : pentaho.type.action.Execution

The action execution.

_emitActionPhaseWillEvent(actionExecution)
Protected

Emits the will phase event of an action execution.

The default implementation delegates to _emitGeneric.

Source: javascript/web/pentaho/type/action/impl/Target.js, line 206

Inherited From: pentaho.type.action.impl.Target#_emitActionPhaseWillEvent

Parameters:
Name Default Value Summary
actionExecution : pentaho.type.action.Execution

The action execution.

_emitGeneric(source, eventArgs, type, phase, keyArgs) : boolean
Protected

Emits an event given an arbitrary payload object, its type and phase. Returns the event payload object, unless the event is canceled.

Source: javascript/web/pentaho/lang/EventSource.js, line 325

Overrides: pentaho.type.action.impl.Target#_emitGeneric

Parameters:
Name Default Value Summary
source : object

The this value of listener functions.

eventArgs : Array

The arguments of listener functions.

type : nonEmptyString

The type of the event.

phase : nonEmptyString
Optional

The phase of the event. For unstructured events don't specify this argument (or specify a Nully value).

keyArgs : Object
Optional

The keyword arguments' object.

Parameters:
Name Default Value Summary
isCanceled : function
Optional

A predicate that indicates if the given event args are in a canceled state. Its this value is the value of source.

errorHandler : function
Optional

When specified with a null value, no error handling is performed and errors thrown by listeners are thrown back to this method's caller. When unspecified or specified as undefined, defaults to a function that simply logs the listener errors, and lets execution continue to the following listeners. The function arguments are: the error, the eventArgs, the event type and the event phase. Its this value is the value of source.

interceptor : function
Optional
null

A function which is called for each event listener function, with the arguments listener, source, eventArgs and the index of the listener.

Returns:
Name Description
boolean

false when the event is canceled; true, otherwise.

_emitGenericAllAsync(source, eventArgs, type, phase, keyArgs) : Promise.<object>
Protected

Emits an event asynchronously, given an arbitrary payload object, its type and phase, and succeeding if every listener succeeds.

Listeners are called in parallel.

Returns a promise that is fulfilled or rejected with the event payload object. If any listener throws or rejects, the returned promise is rejected as well.

Source: javascript/web/pentaho/lang/EventSource.js, line 454

Overrides: pentaho.type.action.impl.Target#_emitGenericAllAsync

Parameters:
Name Default Value Summary
source : object

The this value of listener functions.

eventArgs : Array

The arguments of listener functions.

type : nonEmptyString

The type of the event.

phase : nonEmptyString
Optional

The phase of the event. For unstructured events don't specify this argument (or specify a Nully value).

keyArgs : Object
Optional

The keyword arguments' object.

Parameters:
Name Default Value Summary
isCanceled : function
Optional

A predicate that indicates if the given event args are in a canceled state. Its this value is the value of source.

getCancellationReason : function
Optional

A function that given the event args returns its a cancellation reason, usually an Error. Its this value is the value of source.

errorHandler : function
Optional

When specified with a null value, no error handling is performed. Errors thrown by, or promises rejected by, any listeners cause the whole event to be rejected.

When unspecified or specified as undefined, defaults to a function that simply logs any listener errors, yet always succeeding.

The function arguments are: the error, the event, the event type and the event phase.

Returns:
Name Description
Promise.<object>

A promise. When fulfilled, it is with the value undefined. When rejected due to a thrown error, the rejection reason is that error. When explicitly rejected by the error handler, the given rejection reason is preserved. When rejected due to a cancellation, the rejection reason is the cancellation reason, if any.

_emitSafe(event) : pentaho.lang.Event
Protected

Variation of the _emit method in which errors thrown by event listeners are caught and logged.

If an event listener throws an error, the following event listeners are still processed.

Source: javascript/web/pentaho/lang/EventSource.js, line 291

Overrides: pentaho.type.action.impl.Target#_emitSafe

Parameters:
Name Default Value Summary
event : pentaho.lang.Event

The event object.

Returns:
Name Description
pentaho.lang.Event | null

The given event object or null, when canceled.

See also: pentaho.lang.EventSource#_emit , pentaho.lang.EventSource#_emitGeneric

_equals(other) : boolean
Protected

Gets a value that indicates if a given distinct, non-null value of the same type represents the same entity.

The default implementation considers two values equal if they have the equal keys.

Source: javascript/web/pentaho/type/Value.js, line 135

Inherited From: pentaho.type.Value#_equals

Parameters:
Name Default Value Summary
other : pentaho.type.Value

A distinct value to test for equality.

Returns:
Name Description
boolean

true if the given value is equal to this one; false, otherwise.

See also: pentaho.type.Value#equals , pentaho.type.Value#$key

_hasListeners(type, phase) : boolean
Protected

Determines if there are any registrations for a given event type and, optionally, phase.

This method can be used to avoid creating expensive event objects for an event type and, optionally, phase, that don't have registrations.

Source: javascript/web/pentaho/lang/EventSource.js, line 218

Overrides: pentaho.type.action.impl.Target#_hasListeners

Parameters:
Name Default Value Summary
type : nonEmptyString

The type of the event.

phase : nonEmptyString
Optional

The phase of a structured event. For unstructured events don't specify this argument. For structured events, if this argument is not specified, the result will be true if there are any listeners, for any of the phases.

Returns:
Name Description
boolean

true if the event has any listeners for the given event type and phase; false, otherwise.

Examples

if(this._hasListeners("click")) {

 var event = new Event("click", this, true);

 if(this._emit(event)) {
 // ...
 }
}
if(this._hasListeners("select")) {

 var event = new Event("select");

 if(this._emitGeneric(this, [event], "select", "will")) {

 // Select ...

 this._emitGeneric(this, [event], "select", "finally");
 }
}
_init(viewSpec)
Protected

Called when the view is constructed.

Override this method, from a configuration mixin class, to perform any initialization.

Source: javascript/web/pentaho/visual/base/View.js, line 277

Parameters:
Name Default Value Summary
viewSpec : pentaho.visual.base.spec.IViewEx

The view specification provided at construction time, if any.

_initClone(clone)
Protected

Initializes a shallow clone of this container.

The default implementation calls pentaho.type.mixins.Container#_initContainer.

Source: javascript/web/pentaho/type/mixins/Container.js, line 121

Inherited From: pentaho.type.mixins.Container#_initClone

Parameters:
Name Default Value Summary
clone : pentaho.type.mixins.Container

The cloned container to initialize.

_initContainer()
Protected

Initializes a container instance.

Source: javascript/web/pentaho/type/mixins/Container.js, line 55

Inherited From: pentaho.type.mixins.Container#_initContainer

_initDomContainer()
Protected

Called to initialize the DOM container, when it is set.

Can be used to initialize the HTML content and/or to attach event handlers.

Source: javascript/web/pentaho/visual/base/View.js, line 336

_initProperties(spec)
Protected

Initializes the properties of the complex instance from a the given specification.

Source: javascript/web/pentaho/type/Complex.js, line 121

Inherited From: pentaho.type.Complex#_initProperties

Parameters:
Name Default Value Summary
spec : pentaho.type.spec.Complex
Optional

A complex specification.

_onChangeClassify(dirtyPropGroups, changeset)
Protected

Called when the view properties have changed.

The default implementation marks the view as dirty. More specifically, it marks the property groups of the properties affected by the given changeset as dirty.

The recognized property groups are those of View.PropertyGroups.

Implementations can override this method to change the default behavior for some or all of the model and view properties.

Source: javascript/web/pentaho/visual/base/View.js, line 490

Parameters:
Name Default Value Summary
dirtyPropGroups : pentaho.util.BitSet

A bit set of property groups that should be set dirty. Use the values of View.PropertyGroups as bit values.

changeset : pentaho.type.Changeset

The model's changeset.

See also: pentaho.visual.base.View#_updateAll

_onChangeDid(changeset)
Protected

Called after a changeset has been committed.

The default implementation emits the "did:change" event for the given changeset, if there are any listeners.

When overriding, be sure to call the base implementation.

Source: javascript/web/pentaho/type/mixins/Container.js, line 300

Overrides: pentaho.type.Complex#_onChangeDid

Parameters:
Name Default Value Summary
changeset : pentaho.type.changes.Changeset

The set of changes.

_onChangeDirty(dirtyPropGroups)
Protected

Called when a change caused relevant property groups to be marked as dirty.

The default implementation auto-updates the view, if possible.

Source: javascript/web/pentaho/visual/base/View.js, line 532

Parameters:
Name Default Value Summary
dirtyPropGroups : pentaho.util.BitSet

A bit set of property groups that were changed. Use the values of View.PropertyGroups as bit values.

_onChangeRejected(changeset, reason)
Protected

Called after a changeset has been rejected.

The default implementation emits the "rejected:change" event for the given changeset, if there are any listeners.

When overriding, be sure to call the base implementation.

Source: javascript/web/pentaho/type/mixins/Container.js, line 321

Inherited From: pentaho.type.mixins.Container#_onChangeRejected

Parameters:
Name Default Value Summary
changeset : pentaho.type.changes.Changeset

The set of changes.

reason : Error

The reason why the changes were rejected.

_onChangeWill(changeset, keyArgs) : pentaho.lang.UserError
Protected

Called before a changeset is committed.

The default implementation emits the "will:change" event for the given changeset, if there are any listeners.

When overriding, be sure to call the base implementation.

Source: javascript/web/pentaho/type/mixins/Container.js, line 262

Inherited From: pentaho.type.mixins.Container#_onChangeWill

Parameters:
Name Default Value Summary
changeset : pentaho.type.changes.Changeset

The set of changes.

keyArgs : Object
Optional

The keyword arguments' object. See EventSource#_emitGeneric.

Returns:
Name Description
pentaho.lang.UserError

An error if the changeset was canceled; null otherwise.

_onUpdateDo(updateActionExecution) : Promise
Protected

Performs the do phase of an update action execution.

The default implementation finally updates the view, if it is dirty and valid.

Source: javascript/web/pentaho/visual/base/View.js, line 704

Parameters:
Name Default Value Summary
updateActionExecution : pentaho.type.action.Execution

The update action execution.

Returns:
Name Description
Promise

A promise that is fulfilled when the update action has completed successfully.

_onUpdateFinally(updateActionExecution)
Protected

Performs the finally phase of an update action execution.

The default implementation calls _emitActionPhaseFinallyEvent.

Source: javascript/web/pentaho/visual/base/View.js, line 718

Parameters:
Name Default Value Summary
updateActionExecution : pentaho.type.action.Execution

The update action execution.

_onUpdateInit(updateActionExecution)
Protected

Performs the init phase of an update action execution.

The default implementation does nothing.

Source: javascript/web/pentaho/visual/base/View.js, line 674

Parameters:
Name Default Value Summary
updateActionExecution : pentaho.type.action.Execution

The update action execution.

_onUpdateWill(updateActionExecution)
Protected

Performs the will phase of an update action execution.

The default implementation calls _emitActionPhaseWillEvent.

Source: javascript/web/pentaho/visual/base/View.js, line 687

Parameters:
Name Default Value Summary
updateActionExecution : pentaho.type.action.Execution

The update action execution.

_releaseDomContainer()
Protected

Called to release any references to the DOM container.

It is the responsibility of the container application to clean up the container element's content, when it is no longer needed. On the other hand, it is the responsibility of the view to clean up any DOM event handlers or references it may hold on the container element or any of its children.

Currently, this method is automatically called from the dispose method.

The default implementation clears the DOM container property and unregisters from any DOM events.

If an implementation has additional properties containing DOM nodes, or other attached DOM event handlers, then it must override this method (and call base) and set these properties to null, so that memory-leaks are not caused.

Source: javascript/web/pentaho/visual/base/View.js, line 360

_updateAll()
Protected

Fully renders or updates the view.

The first update of a visualization is always a full update.

The default implementation does nothing. Implementations should override this method and implement a complete rendering of the visualization.

Besides implementing this method, implementations should consider implementing one or more of the optional partial update methods, like _updateData, _updateSize, _updateSelection and _updateGeneral.

Other appropriate combinations of these can also be implemented, for example, _updateSizeAndSelection, by combining the names of the known property groups: Data, Size, Selection and General, with an And to form a corresponding method name. For more information on property groups, see View.PropertyGroups.

The update operation selects the best fit partial methods to actually update the view.

Source: javascript/web/pentaho/visual/base/View.js, line 1339

See also: pentaho.visual.base.View#update , pentaho.visual.base.View.PropertyGroups , pentaho.visual.base.View#_onChangeClassify

_updateData()
Protected

Updates the view, taking into account that only the data-related model properties have changed.

This is an optional method - there is no base implementation.

Implement this method to provide a faster way to update the data displayed by the view. When not specified, and no other applicable partial update method exists, the view is updated using the _updateAll method.

Source: javascript/web/pentaho/visual/base/View.js, line 1378

See also: pentaho.visual.base.View#_updateAll

_updateGeneral()
Protected

Updates the view, taking into account that only "general" model properties have changed.

This is an optional method - there is no base implementation.

Implement this method to provide a faster way to update the "general information" displayed by the view. When not specified, and no other applicable partial update method exists, the view is updated using the _updateAll method.

Source: javascript/web/pentaho/visual/base/View.js, line 1396

See also: pentaho.visual.base.View#_updateAll

_updateSelection()
Protected

Updates the view, taking into account that only the selection-related model properties have changed.

This is an optional method - there is no base implementation.

Implement this method to provide a faster way to update the selection of the view. When not specified, and no other applicable partial update method exists, the view is updated using the _updateAll method.

Source: javascript/web/pentaho/visual/base/View.js, line 1360

See also: pentaho.visual.base.View#_updateAll

_updateSize()
Protected

Updates the view, taking into account that only the dimensions of the view have changed.

This is an optional method - there is no base implementation.

Implement this method to provide a faster way to resize a view. When not specified, and no other applicable partial update method exists, the full _updateAll method is used to update the view.

Source: javascript/web/pentaho/visual/base/View.js, line 1342

See also: pentaho.visual.base.View#_updateAll

Implements:
act(action) : pentaho.type.action.Execution

Executes or starts execution of a given action in this target and returns the corresponding action execution instance.

This method can be given synchronous or asynchronous actions. To wait for the result of an asynchronous action, obtain the promise property of the returned action execution instance.

Source: doc-js/pentaho/type/action/ITarget.jsdoc, line 37

Overrides: pentaho.type.action.impl.Target#act

Parameters:
Name Default Value Summary
action : pentaho.type.action.Base | pentaho.type.action.spec.IBase

The action or action specification to execute.

Returns:
Name Description
pentaho.type.action.Execution

The resulting action execution.

actAsync(action) : Promise

Executes a given action with this view as its target and waits for its outcome.

Emits a structured event of a type equal to the action type's id, with the action as event payload, for each of the action's phases.

This method can be given synchronous or asynchronous actions, and can be used when uniformity in treatment is desired and it is needed to know the outcome of the asynchronous action.

Source: javascript/web/pentaho/visual/base/View.js, line 1262

Parameters:
Name Default Value Summary
action : pentaho.type.action.Base

The action to execute.

Returns:
Name Description
Promise

A promise that is fulfilled with the action's result or rejected with the action's error.

See also: pentaho.visual.base.View#act

assertValid()

Ensures that the value is valid, and throws the first validation error if it is not.

This method calls the validate method.

Source: javascript/web/pentaho/type/Value.js, line 202

Inherited From: pentaho.type.Value#assertValid

Throws:
Name Description
pentaho.type.ValidationError

When the value is not valid, the first error returned by the validate method.

clone() : pentaho.type.Value
Abstract

Creates a shallow clone of this value.

Source: javascript/web/pentaho/type/Value.js, line 93

Inherited From: pentaho.type.Value#clone

Returns:
Name Description
pentaho.type.Value

The value clone.

compare(other) : number

Compares this element to another according to its relative order.

Execution proceeds as follows:

  1. If other is Nully, it is considered to occur before this one;
  2. If other is identical to this one, as per JavaScript's === operator, it has the same order;
  3. If other does not have the same constructor as this one, it has the same order;
  4. If other is _equals to this one, it has the same order;
  5. Otherwise, the operation is delegated to the first value's _compare method.

Source: javascript/web/pentaho/type/Element.js, line 76

Inherited From: pentaho.type.Element#compare

Parameters:
Name Default Value Summary
other : pentaho.type.Element | undefined

The other element value.

Returns:
Name Description
number

-1 if this value is before other; 1 if this value is after other; 0, otherwise.

See also: pentaho.type.Element#_compare , pentaho.type.Value#equals

Implements:
configure(config)

Configures this value with a given configuration.

This method ensures a transaction exists and then delegates to _configure.

For more information on the semantics of configuration, see Complex#_configure and List#_configure.

Source: javascript/web/pentaho/type/Value.js, line 232

Inherited From: pentaho.type.Value#configure

Parameters:
Name Default Value Summary
config : any

The value configuration.

Throws:
Name Description
TypeError

When the value would be changed and its type is read-only.

See also: pentaho.type.Element#configureOrCreate , pentaho.type.Complex#_configure , pentaho.type.List#_configure

configureOrCreate(config) : pentaho.type.Element

Configures this value with a given configuration, if it is possible. Otherwise creates and returns a new value based on this one, but with the configuration applied.

If the given configuration is Nully or identical to this, then this is immediately returned. Otherwise, this method ensures that a transaction exists and delegates to the _configureOrCreate method.

This method considers configuration to not be possible in the following situations:

  1. this instance is of a read-only type;
  2. config is of an isEntity type and is not equals to this value;
  3. config is not an instance of an isEntity type but is an instance of Value and its constructor is not the same as this;
  4. config is not an instance of Value - it is a specification and: 4.1. it contains an inline type property, _, identifying a different type than that of this instance; 4.2. this instance is of an isEntity type and config contains key properties that
    reference another entity.

If configuration is considered possible, the actual configuration is delegated to the configure method.

Source: javascript/web/pentaho/type/Element.js, line 141

Inherited From: pentaho.type.Element#configureOrCreate

Parameters:
Name Default Value Summary
config : any

The value configuration.

Returns:
Name Description
pentaho.type.Element

this value, if the configuration could be applied to it; a new, configured value, if not.

countOf(name, sloppy) : number

Gets the number of values of a given property.

When the specified property is a list property, its count is returned.

When the specified property is not a list property, 0 is returned if it is null; 1, otherwise.

Source: javascript/web/pentaho/type/Complex.js, line 528

Inherited From: pentaho.type.Complex#countOf

Parameters:
Name Default Value Summary
name : string | pentaho.type.PropertyType

The property name or type object.

sloppy : boolean
Optional
false

Indicates if an error is thrown if the specified property is not defined.

Returns:
Name Description
number

The number of values.

Throws:
Name Description
pentaho.lang.ArgumentInvalidError

When sloppy is false and a property with name name is not defined.

countRangeOf(name) : pentaho.IRange

Gets the current valid count range of values of a given property.

Source: javascript/web/pentaho/type/Complex.js, line 578

Inherited From: pentaho.type.Complex#countRangeOf

Parameters:
Name Default Value Summary
name : string | pentaho.type.PropertyType

The property name or type object.

Returns:
Name Description
pentaho.IRange

The range of the property.

Throws:
Name Description
pentaho.lang.ArgumentInvalidError

When a property with name name is not defined.

Implements:
dispose()

Disposes the view by freeing external resources held by the view.

The default implementation calls _releaseDomContainer to release the DOM container.

Source: javascript/web/pentaho/visual/base/View.js, line 819

domainOf(name) : Array.<pentaho.type.Element>

Gets the current list of valid values of a given property.

Source: javascript/web/pentaho/type/Complex.js, line 611

Inherited From: pentaho.type.Complex#domainOf

Parameters:
Name Default Value Summary
name : string | pentaho.type.PropertyType
Optional

The property name or type object.

Returns:
Name Description
Array.<pentaho.type.Element>

An array of elements if the property is constrained; null otherwise.

Throws:
Name Description
pentaho.lang.ArgumentInvalidError

When a property with name name is not defined.

equals(other) : boolean

Determines if a given value represents the same entity.

This method checks if the given value is identical to this one. Otherwise, if not Nully and has the same constructor, execution is delegated to this value's _equals method.

Source: javascript/web/pentaho/type/Value.js, line 116

Inherited From: pentaho.type.Value#equals

Parameters:
Name Default Value Summary
other : pentaho.type.Value

A value to test for equality.

Returns:
Name Description
boolean

true if the given value is equal to this one; or, false, otherwise.

See also: pentaho.type.Value#_equals

equalsContent(other) : boolean

Gets a value that indicates if a given equal value has the same content as this one.

This method must only be called if the equals method returns true.

The default implementation returns false.

Source: javascript/web/pentaho/type/Value.js, line 152

Inherited From: pentaho.type.Value#equalsContent

Parameters:
Name Default Value Summary
other : pentaho.type.Value

An equal value to test for content-equality.

Returns:
Name Description
boolean

true if the given value is equal in content to this one; false, otherwise.

See also: pentaho.type.Value#equals

extend(source, keyArgs) : Object

Extend an object with the properties of another.

Methods that are overridden are accessible through this.base.

This object is extended, but its class doesn't change.

Source: javascript/web/pentaho/lang/Base.js, line 1037

Overrides: pentaho.type.Complex#extend

Parameters:
Name Default Value Summary
source : Object

The instance specification.

keyArgs : Object
Optional

The keyword arguments.

Parameters:
Name Default Value Summary
exclude : Object
Optional

A map of property names to exclude from source.

Returns:
Name Description
Object

This object.

get(name, sloppy) : pentaho.type.Value | Nully

Gets the value of a property.

If the specified property is not defined and sloppy is true, undefined is returned.

A list property always has a non-null value, possibly an empty list, but never null. An element property can have a null value.

Source: javascript/web/pentaho/type/Complex.js, line 249

Inherited From: pentaho.type.Complex#get

Parameters:
Name Default Value Summary
name : string | pentaho.type.PropertyType
Optional

The property name or type object.

sloppy : boolean
Optional
false

Indicates if an error is thrown if the specified property is not defined.

Returns:
Name Description
pentaho.type.Value | Nully

The value of the property, or a Nully value.

Throws:
Name Description
pentaho.lang.ArgumentInvalidError

When sloppy is false and a property with name name is not defined.

See also: pentaho.type.Complex#getv , pentaho.type.Complex#getf

getf(name, sloppy) : string

Gets the string representation of the value of a property.

This method reads the value of the property by calling Complex#get.

When the latter returns a Nully value, "" is returned. Otherwise, the result of the value's toString() method is returned.

For a Simple type, this corresponds to returning its formatted attribute, when it is not null. For Complex and List types, varies with the implementation.

Source: javascript/web/pentaho/type/Complex.js, line 340

Inherited From: pentaho.type.Complex#getf

Parameters:
Name Default Value Summary
name : string | pentaho.type.PropertyType

The property name or type object.

sloppy : boolean
Optional
false

Indicates if an error is thrown if the specified property is not defined.

Returns:
Name Description
string

The string representation of the value, or "".

Throws:
Name Description
pentaho.lang.ArgumentInvalidError

When sloppy is false and a property with name name is not defined.

See also: pentaho.type.Complex#get , pentaho.type.Complex#getv

getv(name, sloppy) : any | pentaho.type.Complex | pentaho.type.List | Nully

Gets the primitive value of the value of a property.

This method reads the value of the property by calling Complex#get.

When the latter does not return a Nully value, the result of the value's valueOf() method is returned.

For a Simple type, this corresponds to returning its value attribute. For Complex and List types, this corresponds to the value itself.

Source: javascript/web/pentaho/type/Complex.js, line 311

Inherited From: pentaho.type.Complex#getv

Parameters:
Name Default Value Summary
name : string | pentaho.type.PropertyType

The property name or type object.

sloppy : boolean
Optional
false

Indicates if an error is thrown if the specified property is not defined.

Returns:
Name Description
any | pentaho.type.Complex | pentaho.type.List | Nully

The primitive value of a Simple, the Complex or List value itself, or a Nully value.

Throws:
Name Description
pentaho.lang.ArgumentInvalidError

When sloppy is false and a property with name name is not defined.

See also: pentaho.type.Complex#get , pentaho.type.Complex#getf

isApplicableOf(name) : boolean

Gets a value that indicates if a given property is currently applicable.

Source: javascript/web/pentaho/type/Complex.js, line 548

Inherited From: pentaho.type.Complex#isApplicableOf

Parameters:
Name Default Value Summary
name : string | pentaho.type.PropertyType

The property name or type object.

Returns:
Name Description
boolean

true if the property is applicable; false, otherwise.

Throws:
Name Description
pentaho.lang.ArgumentInvalidError

When a property with name name is not defined.

isDefaultedOf(name) : boolean

Gets a value that indicates if a given property has assumed a default value.

Source: javascript/web/pentaho/type/Complex.js, line 260

Inherited From: pentaho.type.Complex#isDefaultedOf

Parameters:
Name Default Value Summary
name : string | pentaho.type.PropertyType
Optional

The property name or type object.

Returns:
Name Description
boolean

Returns true if the property has been defaulted; false, otherwise.

isEnabledOf(name) : boolean

Gets a value that indicates if a given property is currently enabled.

Source: javascript/web/pentaho/type/Complex.js, line 563

Inherited From: pentaho.type.Complex#isEnabledOf

Parameters:
Name Default Value Summary
name : string | pentaho.type.PropertyType

The property name or property type object.

Returns:
Name Description
boolean

Returns true if the property is enabled; false, otherwise.

Throws:
Name Description
pentaho.lang.ArgumentInvalidError

When a property with name name is not defined.

isRequiredOf(name) : boolean

Gets a value that indicates if a given property is currently required.

A property is currently required if its current pentaho.type.Complex#countRangeOf minimum is at least 1.

Source: javascript/web/pentaho/type/Complex.js, line 596

Inherited From: pentaho.type.Complex#isRequiredOf

Parameters:
Name Default Value Summary
name : string | pentaho.type.PropertyType
Optional

The property name or type object.

Returns:
Name Description
boolean

true if the property is required; false, otherwise.

Throws:
Name Description
pentaho.lang.ArgumentInvalidError

When a property with name name is not defined.

Implements:
off(typeOrHandle, observer)

Removes one registration given its handle, or all registrations of a given event type (or types) and observer (or listener function).

To remove an event registration, it is sufficient to call the dispose method of the registration handle returned by on, upon registration. Alternatively, as a convenience syntax, the registration handle can be passed as the single argument to this method.

It is safe to unregister from an event type while it is being emitted. However, any registrations removed during the current emission will still execute.

Specifying an event registration handle that has already been disposed of has no effect. Specifying an event type and observer (or listener function) that have no registrations has no effect.

Source: doc-js/pentaho/lang/IEventSource.jsdoc, line 131

Overrides: pentaho.type.action.impl.Target#off

Parameters:
Name Default Value Summary
typeOrHandle : nonEmptyString | Array.<nonEmptyString> | pentaho.lang.IEventRegistrationHandle

The type or types of events, or an event registration handle to dispose of. When a string, it can be a comma-separated list of event types.

observer : pentaho.lang.IEventObserver | pentaho.lang.EventListener | pentaho.lang.EventListenerAsync

The event observer (or listener function). Required when typeOrHandle is not an event registration handle; ignored, otherwise.

See also: pentaho.lang.IEventSource#on

Implements:
on(type, observer, keyArgs) : pentaho.lang.IEventRegistrationHandle

Registers an observer (or listener function) for an event(s) of a given type(s).

Optionally, a listening priority may be specified to adjust the order by which an observer is notified, relative to other listeners.

Note that if an observer is registered more than once to the same event type, a new registration is created each time and its listeners will be called once per registration.

It is safe to register for an event type while it is being emitted. However, new registrations are only taken into account in subsequent emissions.

When type represents multiple event types, the returned event registration handle is a composite registration for all of the event types.

This method is compatible with the dojo/on API.

Source: doc-js/pentaho/lang/IEventSource.jsdoc, line 90

Overrides: pentaho.type.action.impl.Target#on

Parameters:
Name Default Value Summary
type : nonEmptyString | Array.<nonEmptyString>

The type or types of events. When a string, it can be a comma-separated list of event types.

observer : pentaho.lang.IEventObserver | pentaho.lang.EventListener | pentaho.lang.EventListenerAsync

The event observer (or listener function).

keyArgs : object
Optional

Keyword arguments.

Parameters:
Name Default Value Summary
priority : number
Optional
0

The listening priority. Higher priority observers are notified of an event before any lower priority observers. The priority can be set to -Infinity or Infinity. In case two observers are assigned the same priority, the registration order determines which is notified first.

Returns:
Name Description
pentaho.lang.IEventRegistrationHandle

An event registration handle that can be used for later removal.

See also: pentaho.lang.IEventSource#off

set(name, valueSpec)

Sets the value of a property.

The value of List properties is automatically created, when complex instance is constructed, and is never replaced by another list value. However, its contents can be modified. On the other hand, for element properties, their value can be replaced.

Execution proceeds as follows:

  1. If the property is a list property:

    1. If value is Nully, the list is cleared by calling the List#clear method; however, if the property is read-only and the list has any elements, an error is thrown instead;
    2. Otherwise, if value is distinct from the current list value, an elements list is extracted from the given value (see ListType#_normalizeInstanceSpec) and execution is delegated to the List#set method; likewise, if changes to the list would result and the property is read-only, an error is thrown;
  2. If the property is an element property:

    1. If value is Nully, the property's default value, if any, is evaluated and value is set to it; the property's new defaulted status will be true.

    2. Otherwise, if the specified value is not Nully, the property's new defaulted status will be false.

    3. If value is not equal to the current value and/or the property's defaulted status changes:

      1. If the property is read-only, an error is thrown.
      2. Otherwise, the current value and the defaulted status are replaced by the new ones.
      3. A change action is executed, resulting in the change events will:change and did:change or rejected:change being emitted.
    4. Otherwise, if value and the defaulted status do not change, nothing is done.

In both cases, of element and list properties, when the given value(s) is a specification, it is first constructed, before any comparison with the current value(s) is performed.

Contrast this behavior with that of the configure method, in which specifications aren't considered to have an identity, a priori. Only if these explicitly identify an entity or value which is incompatible with the current value are they assumed to represent a new value that needs to be constructed.

For element properties, specifications are constructed having as default type the valueType of the property.

For list properties, each element's specification is constructed having as default type the elementType of the property's valueType.

Source: javascript/web/pentaho/type/Complex.js, line 417

Inherited From: pentaho.type.Complex#set

Parameters:
Name Default Value Summary
name : nonEmptyString | pentaho.type.PropertyType

The property name or type object.

valueSpec : any
Optional
null

A value specification.

Fires: event:will:change , event:did:change , event:rejected:change

Throws:
Name Description
pentaho.lang.ArgumentInvalidError

When a property with name name is not defined.

TypeError

When the property is read-only and its value would change.

See also: pentaho.type.Value#configure , pentaho.type.Value#isReadOnly

toJSON() : JsonValue

Creates a top-level JSON specification that describes this instance.

Attributes which do not have a JSON-compatible specification are omitted. Specifically, for inline types, attributes with a function value are not supported.

This method simply calls pentaho.type.Instance#toSpec with argument keyArgs.isJson as true and exists for seamless integration with JavaScript's JSON.stringify method.

Source: javascript/web/pentaho/type/Instance.js, line 197

Inherited From: pentaho.type.Instance#toJSON

Returns:
Name Description
JsonValue

A JSON-compatible specification.

See also: pentaho.type.Instance#toSpec

Implements:
toSpec(keyArgs) : pentaho.type.spec.Instance

Creates a specification that describes this value.

If an ambient specification context, currently exists, it is used to manage the serialization process. Otherwise, one is created and set as current. Then, the actual work is delegated to pentaho.type.Instance#toSpecInContext.

Source: javascript/web/pentaho/type/Value.js, line 272

Inherited From: pentaho.type.Value#toSpec

Parameters:
Name Default Value Summary
keyArgs : Object
Optional

The keyword arguments object. Passed to every value and type serialized within this scope.

Please see the documentation of value subclasses for information on additional, supported keyword arguments.

Parameters:
Name Default Value Summary
isJson : boolean
Optional
false

Generates a JSON-compatible specification. Attributes which do not have a JSON-compatible specification are omitted.

declaredType : pentaho.type.Type
Optional

The base type of this value's storage location. If the value does not have this exact type, its inline type property must be included in the specification. Otherwise, it can be omitted. When unspecified, the inline type property is only included if forceType is true.

forceType : boolean
Optional
false

Forces inclusion of the inline type property, _, in the specification.

omitFormatted : boolean
Optional
false

Omits the formatted value on Simple values' specifications.

preferPropertyArray : boolean
Optional
false

Indicates that, if possible, array form is used for Complex values' specifications.

The array form of a complex value cannot be used when its type must be inlined.

includeDefaults : boolean
Optional
false

When true, all of the properties of Complex values are serialized. When false, the default, only properties whose value is different from their default value are serialized.

Only applies to complex values that are serialized in object form. In array form, all of the properties of complex values are serialized independently of their value.

omitProps : Object
Optional

An object whose own property names with a truthy value are the names of the properties of the current complex type to omit from the serialization.

Only applies when a complex is output in object form. In array form, all properties are output whatever their value.

This argument only applies to complex values and is not passed through to the values of their properties.

Returns:
Name Description
pentaho.type.spec.Instance

A specification of this value.

toSpecInContext(keyArgs) : any

Creates a specification that describes this instance.

Source: javascript/web/pentaho/type/Instance.js, line 177

Inherited From: pentaho.type.Instance#toSpecInContext

Parameters:
Name Default Value Summary
keyArgs : Object
Optional

The keyword arguments' object. Passed to every instance and type serialized within this scope.

Please see the documentation of subclasses for information on additional, supported keyword arguments.

Returns:
Name Description
any

A specification of this instance.

See also: pentaho.type.Instance#toSpec

update() : Promise

Updates the view to match its latest state.

The model is part of the state of the view.

When isAutoUpdate is true, any change to the view automatically triggers its update, through a call to this method.

The update operation is asynchronous. Even if the implementation completes the update synchronously, completion is only advertised later, asynchronously, through the emission of the action execution's finally phase event and the resolution of the returned promise.

If the update method is called when the view is already being updated, the same promise that was returned from the initial call is returned.

Otherwise, if the update method is called and the view is not dirty, a fulfilled promise is returned.

Otherwise, the update method creates an Update action and executes it. This is done by passing the action to the act, and then returning back the promise of the returned action execution.

The update then goes through all of the phases of the execution of an action: init, will, do and finally. In each of this phases, the following corresponding methods are called:

  1. _onUpdateInit; the default implementation does nothing;
  2. _onUpdateWill; the default implementation emits the will phase event of the action's execution;
  3. _onUpdateDo; the default implementation updates the view, proper;
  4. _onUpdateFinally; the default implementation emits the finally phase event of the action's execution.

Note that no events are emitted for the init and do phases.

During the init, will and do phases, the isUpdating property returns true.

During the finally phase, isUpdating returns false. Also, if the implementation or the event listeners further modify the model, a subsequent update action will eventually be executed.

Update proper

If the update action is not canceled or doesn't fail in the init and will phases, the do phase is entered. It is constituted by an update loop which is only exited when either the view is not dirty anymore or an error occurs.

On each iteration of the update loop:

  1. If the view is invalid, the update loop ends with a validation error and the update action is rejected;
  2. Otherwise, the "best fit" partial update method is selected and called to update the view;
  3. If the selected update method throws an error or returns a rejected promise, the update action is rejected;
  4. If the view is not dirty anymore, the update loop ends with success;
  5. Repeat.

Over the view's lifetime, the very first "partial" update method that is selected is always the full update method: updateAll. Subsequent iterations may select _proper partial update methods, such as _updateSize or _updateSelection.

Source: javascript/web/pentaho/visual/base/View.js, line 648

Fires: event:pentaho/visual/action/Update:{will} , event:pentaho/visual/action/Update:{finally}

Returns:
Name Description
Promise

A promise that is fulfilled when the visualization is updated or is rejected in case some error occurs.

See also: pentaho.type.action.Execution , pentaho.visual.base.View#isAutoUpdate , pentaho.visual.base.View#isUpdating , pentaho.visual.base.View#isDirty , pentaho.visual.base.View#_updateAll , pentaho.visual.base.View#_updateData , pentaho.visual.base.View#_updateSize , pentaho.visual.base.View#_updateSelection , pentaho.visual.base.View#_updateGeneral , pentaho.visual.base.View#_onUpdateInit , pentaho.visual.base.View#_onUpdateWill , pentaho.visual.base.View#_onUpdateDo , pentaho.visual.base.View#_onUpdateFinally

validate() : Array.<pentaho.type.ValidationError>

Determines if this value is valid.

The default implementation does nothing and considers the instance valid. Override to implement a type's specific validation logic.

You can use the error utilities in pentaho.type.Util to help in the implementation.

Source: javascript/web/pentaho/type/Value.js, line 187

Inherited From: pentaho.type.Value#validate

Returns:
Name Description
Array.<pentaho.type.ValidationError>

A non-empty array of errors or null.

See also: pentaho.type.Value#$isValid