Spotfire 15.0 Web Player JavaScript API Reference
    Preparing search index...

    Interface Application

    The Application class is used to create a Web Player instance. It is also used to create document instances and connect to global events. If an analysis is opened, the Document object is also accessible from the application.

    interface Application {
        analysisDocument: Document;
        analysisDocuments: Document[];
        close(): void;
        logout(): void;
        onClosed(callback: OnClosedCallback): void;
        onError(callback: OnErrorCallback): void;
        onLoggedOut(callback: OnLoggedOutCallback): void;
        onOpened(callback: OnOpenedCallback): void;
        open(
            analysisPath: string,
            divId: string,
            parameter: string,
            documentId: string,
        ): void;
        openDocument(
            elementId: string,
            initialPage?: string | number,
            customizationInfo?: ICustomization,
        ): Document;
    }
    Index

    Properties

    analysisDocument: Document

    Reference to the first Document object loaded. This property will be null if no document is loaded.

    analysisDocuments: Document[]

    Array with all open documents.

    Methods

    • Closes all currently opened documents. Will raise Application.onClosed once per document. Will raise Application.onError if no document is opened, or the closing failed.

      Returns void

    • Log out. Can be used without having any open documents.

      Returns void

      7.14

    • Registers an event handler for the onClosed event.

      Parameters

      Returns void

    • Registers an event handler for the onError event.

      Parameters

      Returns void

    • Registers an event handler for the onOpened event.

      Parameters

      Returns void

    • Open a given analysis. The Application.onOpened event will be raised when the document is opened.

      Parameters

      • analysisPath: string

        The path in the library to the analysis to open.

      • divId: string

        The id of the DIV element in which to display the Web Player. The Web Player will adapt to the size of the surrounding DIV.

      • parameter: string

        Load parameters for the analysis (bookmarks, Information Link parameters, etc.). Example: 'Parameters.Param = {val1, "Val 2"}; SetPage(pageIndex = 1); ApplyBookmark(bookmarkName="All");'. For more information see: Parameter Configuration Block.

      • documentId: string

        If set, just refresh an existing web analysis.

      Returns void

      Use the Application.openDocument function.

    • Open an analysis document instance specified by the application. The Application.onOpened event will fire when the document is loaded. Multiple documents can be opened for a single application using Application.openDocument. When several documents are created for an application these documents will automatically be linked together.

      Parameters

      • elementId: string

        The id of the DOM element in which to display the Web Player. The Web Player will adapt to the size of this element.

      • OptionalinitialPage: string | number

        Specifies the initial page when opening the analysis. Either page id (boolean) or page title can be used. If not set, the current page of the analysis will be used.

      • OptionalcustomizationInfo: ICustomization

        Customization of the UI. This will override customization set when creating the application.

      Returns Document

      The document. Note that the API methods defined by this instance will be queued until the Application.onOpened event is raised.