Options
All
  • Public
  • Public/Protected
  • All
Menu

Note: This is for single argument commands only. Multiple argument commands should be phased out and avoided.

docs-hide-from-nav

Hierarchy

Index

Constructors

constructor

  • Initializes a new instance of the {@link geocortex.essentialsHtmlViewer.mapping.infrastructure.command.CommandViewModel} class.

    class

    CommandViewModel presents the generic commands along with its attributes such as command parameters.

    constructs

    Parameters

    • app: Application

      The {@link geocortex.essentialsHtmlViewer.ViewerApplication} that this command belongs to.

    • libraryId: string

      The ID of the library this component belongs to.

    • commandName: string

      The name of the command

    • commandParameter: string

      The parameter associated with this command.

    Returns CommandViewModel

Properties

Protected _canExecuteChangedBindingToken

_canExecuteChangedBindingToken: string

Protected _command

_command: TypedCommand<any>

Protected _isDestroyed

_isDestroyed: boolean

app

canExecute

canExecute: Observable<boolean>

Indicates whether the command can currently execute or not.

commandName

commandName: string

Name of the command.

commandParameter

commandParameter: any

The command parameter, as configured.

id

id: string

libraryId

libraryId: string

notExecuteHidden

notExecuteHidden: Observable<boolean>

Methods

applyContext

  • applyContext(context: any): void
  • Applies a new contextual parameter to this command.

    Parameters

    • context: any

    Returns void

auto

  • auto(arg0: any, arg1: any, arg2: any): void
  • Binds a handler to an Observable or to a dojo.connect. Binding to an Observable:

    ``` this.auto(someObservable, function (newValue) { });

    with explicit scope:

    this.auto(someObservable, this, function (newValue) { });

    Alternately, pass an event name as a string to use dojo.connect:

    this.auto(window, "onclick", function () { }); ```

    Parameters

    • arg0: any

      Either an Observable (for observable bindings) or a regular object (if arg1 is a string)

    • arg1: any

      If arg0 is an Observable, a function or scope object. Otherwise, an event name (to use with dojo.connect).

    • arg2: any

      If arg0 is an Observable, a function handler.

    Returns void

destroy

  • destroy(): void
  • Destroys the object completely

    Returns void

destroyBindings

  • destroyBindings(): void

getResource

  • getResource(resourceKey: string, locale?: string): string
  • Gets a language resource from the Application's resource dictionary, given a key, and optional locale. Returns null if the resource does not exist.

    Parameters

    • resourceKey: string
    • Optional locale: string

      The locale of the resource to fetch. Defaults to the current application locale.

    Returns string

initialize

  • initialize(config: any): void

onDestroy

  • onDestroy(): void
  • Override or attach to provide custom clean-up behaviour.

    Returns void

trackCommandHandler

  • trackCommandHandler(command: any, token: any): void
  • Tracks a subscription to an {@link geocortex.framework.commands.Command}, disposing it when this object is disposed with the destroy method.

    Parameters

    • command: any
    • token: any

    Returns void

trackSubscription

  • trackSubscription(event: any, token: any): void
  • Tracks a subscription to an {@link geocortex.framework.events.Event}, disposing it when this object is disposed with the destroy method.

    Parameters

    • event: any
    • token: any

    Returns void