Interface ControlPageApi

ControlPageApiBase extension that provides more functionality.

interface ControlPageApi {
    events: ControlPageEventsApi;
    field: ControlPageFieldApi;
    file: ControlFileApi;
    isExternalObject: boolean;
    isHomepage: boolean;
    masking: MaskingPageApi;
    objectId: string;
    objectName: string;
    addRefreshableControl(control: Control<TypeAttributes>, refreshFn: (() => void), options?: RefreshablePageControlOptions): void;
    cancelEdit(closeTab: boolean): Promise<{
        userSaved: boolean;
    }>;
    edit(): Promise<any>;
    getMode(): PageMode;
    getPageDirty(): undefined | boolean;
    getPageModel(): PageModel;
    hasAnyRefreshableControlRequiresIndex(): boolean;
    isInEditMode(): undefined | boolean;
    isSlidingPanelPinned(): undefined | boolean;
    isToolbarDisabled(): boolean;
    onChange(handler: ((change: PageDataChange | PageModeChange) => void)): void;
    onNavigationStart(callback: (() => void)): void;
    onPropertyChange(handler: ((category: string, property: string, currentValue: any, previousValue: any) => void)): (() => void);
    raiseNotification(notification: string, type: string, autoDismissDuration?: number): void;
    refreshAttachments(): void;
    reloadPage(): Promise<void>;
    reloadRefreshableControls(categoryToRefresh?: string, controlToRefresh?: Control<TypeAttributes>): void;
    removeRefreshableControl(controlToRemove: Control<TypeAttributes>): void;
    save(stopEditing: boolean, closeObject: boolean): Promise<void>;
    setPageDirty(): void;
    setToolbarItemDisabled(actionName: string, setDisabled: boolean): void;
    toggleSlidingPanel<T>(sectionLabel?: string, content?: SlidingPanelContent<T>, panelProperties?: SlidingPanelProperties, onClose?: (() => void), focusPreviousActiveElementOnClose?: boolean): void;
}

Hierarchy (view full)

Properties

Methods related to the hookable events associated with the page.

Methods that relate to object fields associated with the page.

Methods related to the files associated with the page.

isExternalObject: boolean

Checks if the object is external.

isHomepage: boolean

Checks if the page is a Home page.

masking: MaskingPageApi

Access the Page Data Masking API

objectId: string

The object ID, if applicable. Otherwise "".

objectName: string

The object name, if applicable. Otherwise "".

Methods

  • Adds a refreshable control to the page.

    Parameters

    • control: Control<TypeAttributes>

      {Control} Control to add.

    • refreshFn: (() => void)

      {function} Function to be called when the control is refreshed. There are no parameters. Returns void.

        • (): void
        • Returns void

    • Optionaloptions: RefreshablePageControlOptions

      {RefreshablePageControlOptions} Options to be added to the refreshable control.

    Returns void

  • Takes a page out of edit mode. Promise resolves with a boolean value to determine if the user has saved or not. If the user has not saved, the user is prompted to do so.

    Parameters

    • closeTab: boolean

      {boolean} Checks if the tab should close after edit mode is cancelled.

    Returns Promise<{
        userSaved: boolean;
    }>

    A Promise that resolves when the edit has been cancelled.

  • Sets the page to be in edit mode. Used when clicking the Edit button.

    Returns Promise<any>

    A Promise that resolves when the page is put in edit mode.

  • Gets the dirty state of the page.

    Returns undefined | boolean

  • Returns the model of the page in which the calling control resides.

    Returns PageModel

    The current page model object.

  • Returns boolean

    True if any RefreshableControls have options.requiresIndex present. Otherwise False

  • Checks if a page is in edit mode.

    Returns undefined | boolean

    A boolean value that checks whether or not a page is in edit mode. Undefined if there is no page model.

  • Checks if the sliding panel is pinned

    Returns undefined | boolean

    A boolean value that checks whether the sliding panel is pinned.

  • Returns the disabled status of the page toolbar.

    Returns boolean

    True, if the toolbar is disabled. Otherwise false.

  • Registers a function to be invoked whenever a relevant change happens. The handler receives an object that gives information about the change event. There are two types of changes - PageDataChange when the data in the page model changes, and PageModeChange when the page mode changes.

    Parameters

    Returns void

  • Parameters

    • callback: (() => void)
        • (): void
        • Returns void

    Returns void

  • Registers a function to be invoked whenever one of the calling control's properties change.

    Parameters

    • handler: ((category: string, property: string, currentValue: any, previousValue: any) => void)

      {function} Function to be invoked on property change. Parameters are (category: string, property: string, currentValue: any, previousValue: any).

        • (category, property, currentValue, previousValue): void
        • Parameters

          • category: string
          • property: string
          • currentValue: any
          • previousValue: any

          Returns void

    Returns (() => void)

    A function that stops the handler from being invoked.

      • (): void
      • Returns void

  • Triggers a certain type of notification for users. For example, a type EDIT_FAIL notification if a sheet has failed to be added to a workspace.

    Parameters

    • notification: string

      {string} Message to be displayed on the notification.

    • type: string

      {string} Type of notification. For example LOCK, EDIT_FAIL, VERSION_MISMATCH.

    • OptionalautoDismissDuration: number

      {number} Length of time before the notification should be dismissed.

    Returns void

  • Refreshes the attachments grid to display new attachments when a new attachment is uploaded.

    Returns void

  • Reloads an instance of a page.

    Returns Promise<void>

    A Promise that resolves when the page is reloaded.

  • Refreshes a control when updated data is displayed. By default, attempts to refresh all controls. Specify categoryToRefresh or controlToRefresh to restrict what is refreshed.

    Parameters

    • OptionalcategoryToRefresh: string

      {(string|undefined)} Name of the category to be refreshed.

    • OptionalcontrolToRefresh: Control<TypeAttributes>

      {Control} Individual control to be refreshed.

    Returns void

  • Removes a refreshable control from the page.

    Parameters

    Returns void

  • Saves a page after editing.

    Parameters

    • stopEditing: boolean

      {boolean} Checks if the page should leave edit mode after it is saved.

    • closeObject: boolean

      {boolean} Checks if the page should be closed after it is saved.

    Returns Promise<void>

    A Promise which resolves when the page has been saved.

  • Sets a page to be dirty, that is, when it has been edited and not saved.

    Returns void

  • Sets the toolbar control to be disabled.

    Parameters

    • actionName: string

      the toolbar action name.

    • setDisabled: boolean

      disable the toolbar item.

    Returns void

  • Toggle the page-level sliding panel. This panel should be used to contain information that is supplementary to the document, for example attachments or workflow tasks.

    Type Parameters

    • T

    Parameters

    • OptionalsectionLabel: string

      {string} Describes the section, this should be internationalized.

    • Optionalcontent: SlidingPanelContent<T>

      {SlidingPanelContent} The content of the sliding panel.

    • OptionalpanelProperties: SlidingPanelProperties

      {SlidingPanelProperties} Properties for the panel. When providing a url for content: the panel properties will be available on the controller's "slidingPanel" object. When providing a selector for content: the properties will be set on the element to be created.

    • OptionalonClose: (() => void)

      {function} A callback function invoked when the panel is dismissed. There are no parameters. Returns void.

        • (): void
        • Returns void

    • OptionalfocusPreviousActiveElementOnClose: boolean

      {boolean} Toggle for whether the app should apply focus to the last active element before the panel was opened.

    Returns void