ComponentSpace

baja. ComponentSpace

new ComponentSpace(name, ordInHost, host)

Description:
  • Represents a baja:ComponentSpace in BajaScript.

Source:
Implements:
Parameters:
Name Type Description
name String
ordInHost String
host

Extends

Methods

equals(obj) → {Boolean}

Description:
  • Indicates whether some other object is equal to this one.

Source:
Inherited From:
Parameters:
Name Type Description
obj Object

the reference object with which to compare.

Returns:

true if this object is the same as the obj argument; false otherwise.

Type
Boolean

equivalent(obj) → {Boolean}

Description:
  • Equivalence test.

    equivalent() is used to compare if two Objects have equivalent
    state, but might not want to return true for equals since it
    it has implied semantics for many operations. The default
    implementation returns the result of baja.Object#equals.

Source:
Inherited From:
Parameters:
Name Type Description
obj
Returns:
Type
Boolean

getAbsoluteOrd(paramsopt) → {baja.Ord}

Description:
  • Return absolute ORD for the Component Space. May be session-aware.

Source:
See:
Parameters:
Name Type Attributes Description
params object <optional>
Properties
Name Type Attributes Description
sessionAware boolean <optional>
Returns:
Type
baja.Ord

getAgents(isopt, batchopt) → {Promise}

Description:
  • Returns a promise that resolves to the agent list for this Object.

Source:
Inherited From:
See:
Parameters:
Name Type Attributes Description
is Array.<String> <optional>

An optional array of filters to add to the
agent query.

batch baja.comm.Batch <optional>

An optional object used to batch network
calls together.

Returns:

A promise that will resolve with the Agent Info.

Type
Promise

getIcon() → {baja.Icon}

Description:
  • Return the Object's Icon.

Source:
Inherited From:
Returns:
Type
baja.Icon

getNavChildren()

Description:
  • Access the Nav Children.

Source:
Overrides:
See:
Returns:

promise a promise that will be resolved once the callbacks have been invoked.

getNavDescription() → {String}

Description:
  • Return the Nav Description.

Source:
Inherited From:
Returns:
Type
String

getNavDisplayName() → {String}

Description:
  • Return the Nav Display Name.

Source:
Inherited From:
Returns:
Type
String

getNavIcon() → {baja.Icon}

Description:
  • Return the Nav Icon.

Source:
Overrides:
Returns:
Type
baja.Icon

getNavName() → {String}

Description:
  • Return the Nav Name.

Source:
Inherited From:
Returns:
Type
String

getNavParent() → {baja.NavContainer}

Description:
  • Return the Nav Parent (or null if there's no parent).

Source:
Inherited From:
Returns:
Type
baja.NavContainer

getNavTypeSpec() → {String}

Description:
  • Return the type spec of object this nav node navigates to.

Source:
Inherited From:
Returns:

The nav type spec.

Type
String

getOrdInSession() → {baja.Ord}

Description:
  • Return the ORD in Session for the Component Space.

Source:
Returns:
Type
baja.Ord

getPermissions() → {baja.Permissions}

Source:
Since:
  • Niagara 4.14
Inherited From:
Throws:

if this node is not a BIProtected

Type
Error
Returns:
Type
baja.Permissions

getRootComponent() → {baja.Component}

Description:
  • Return the root Component of the Component Space.

Source:
Returns:

the root Component for the Space.

Type
baja.Component

getType() → {Type}

Description:
  • Get the type of this instance.

Source:
Inherited From:
Returns:
Type
Type

getTypeDisplayName(cxopt) → {Promise.<string>|string}

Description:
  • Gets the friendly type display name for this object.

Source:
Since:
  • Niagara 4.10
Inherited From:
See:
  • baja.Type#getDisplayName
Parameters:
Name Type Attributes Description
cx Object <optional>

a context to be passed down to Type

Returns:

If no context is provided, the type
display name is returned synchronously as a string. If context provided,
the type display name is resolved via a promise as a string.

Type
Promise.<string> | string

isSpaceReadonly() → {Boolean}

Description:
  • Return true if the entire ComponentSpace is readonly.

Source:
Returns:

true if readonly.

Type
Boolean

sync(objopt) → {Promise}

Description:
  • Sync the Component Space.

    If the Space is a Proxy, this method will result in an
    asynchronous network call to sync the master Space with this one.

Source:
Parameters:
Name Type Attributes Description
obj Object <optional>

the object literal for the method's arguments.

Properties
Name Type Attributes Description
ok function <optional>

(Deprecated: use Promise) the ok callback.
Called once the Component Space has been successfully synchronized with the
Server.

fail function <optional>

(Deprecated: use Promise) the fail callback.
Called If the Component Space can't be synchronized.

batch baja.comm.Batch <optional>

if defined, any network calls will be
batched into this object.

Returns:

a promise that will be resolved once the space has been
synced.

Type
Promise

toEnabledMixIns(objopt) → {Promise.<Array.<Object>>}

Description:
  • Resolve to a list of enabled mix-in Types for the Component Space.

    An Object Literal is used for the method's arguments.

Source:
Parameters:
Name Type Attributes Description
obj Object <optional>

the Object Literal for the method's arguments.

Properties
Name Type Attributes Description
ok function <optional>

(Deprecated: use Promise) Callback handler
invoked once the enabled mix-in Types have been resolved.

fail function <optional>

(Deprecated: use Promise) the fail callback.

batch baja.comm.Batch <optional>

if defined, any network calls will be
batched into this object.

Returns:

a promise that will be resolved once
the mixin information has been retrieved.

Type
Promise.<Array.<Object>>

toString(cxopt) → {String|Promise.<String>}

Description:
  • Returns the String representation of this Object.

    When implementing toString() on one of your own Objects, it should
    adhere to the following contract.

    • When called with no arguments, it must return a string directly.
    • It can also be called with an object literal. In this case, it may
      return a Promise to be resolved with a string, or it may return a string
      directly as normal. This case is sort of analogous to
      javax.baja.sys.Localizable#toString(Context).

    Therefore, when calling toString() on an Object of unknown Type using an
    object literal as an argument, it's important to wrap the call in
    Promise.resolve().

Source:
Inherited From:
Examples

When no context is passed, toString() must always return a string directly.

var bool = comp.get('boolean');
baja.outln(bool.toString()); // 'false'

When a context is passed, some Objects may return a Promise.

var bool = comp.get('boolean');
bool.toString({ trueText: 'Yes', falseText: 'No' })
  .then(function (str) {
    baja.outln(str); // 'No'
  });

If you don't know the type of the Object, use Promise.resolve() for safety.

var displayFacets = comp.get('displayFacets'),
    value = comp.get('value');
Promise.resolve(value.toString(displayFacets.toObject()))
  .then(function (str) {
    baja.outln(str); // formatted according to displayFacets
  });
Parameters:
Name Type Attributes Description
cx Object <optional>

optional context information to be used when
formatting the string

Returns:

a string (if no context passed), or
either a string or a Promise (if context passed).

Type
String | Promise.<String>

valueOf() → {*}

Description:
  • Return the inner value of the object.

    By default the object's instance is returned.

Source:
Inherited From:
Returns:

the inner value of the object or just the object's instance.

Type
*