Options
All
  • Public
  • Public/Protected
  • All
Menu

The object with functionality related to multiple window support in PrimeFaces applications.

Index

Variables

CLIENT_WINDOW_SESSION_STORAGE: string

The key for the session storage entry holding the client window ID.

CLIENT_WINDOW_URL_PARAM: string

The name of the URL parameter holding the client window ID.

LENGTH_CLIENT_WINDOW_ID: number

The number of characters of the client window ID. Each client window ID must be of this length, or it is invalid.

TEMP_CLIENT_WINDOW_ID: string

The value of the temporary client window ID, used for requesting a new ID, see requestNewClientWindowId.

clientWindowId: null | string

The current window ID, as received from the server. May be null when to ID was provided.

initialRedirect: boolean

Whether the currently loaded page is from the first redirect.

initialized: boolean

Whether the init function was called already.

Functions

  • assertClientWindowId(): void
  • Checks whether the client window ID is valid. If not, requests a new client window ID from the server via reloading the current page.

    Returns void

  • cleanupCookies(): void
  • Makes sure the temporary cookie for the client window ID is expired.

    Returns void

  • expireCookie(cookieName: string): void
  • Expires the cookie with the given name by setting a cookie with the appropriate max-age and expires settings.

    Parameters

    • cookieName: string

      Name of the cookie to expire.

    Returns void

  • getUrlParameter(uri: string, name: string): string | null
  • Returns the value of the URL parameter with the given name. When the URL contains multiple URL parameters with the same name, the value of the first URL parameter is returned.

    Parameters

    • uri: string

      An URL from which to extract an URL parameter.

    • name: string

      Name of the URL parameter to retrieve.

    Returns string | null

    The value of the given URL parameter. Returns the empty string when the URL parameter is present, but has no value. Returns null when no URL parameter with the given name exists.

  • init(clientWindowId: string, initialRedirect: boolean): void
  • Initializes the client window feature. Usually invoked on page load. This method should only be called once per page.

    Parameters

    • clientWindowId: string

      The current client window ID.

    • initialRedirect: boolean

      Whether the currently loaded page is from the first redirect.

    Returns void

  • replaceUrlParam(uri: string, parameterName: string, parameterValue?: null | string): string
  • Given a URL, removes all URL parameters with the given name, adds a new URL parameter with the given value, and returns the new URL with the replaced parameter. If the URL contains multiple URL parameters with the same name, they are all removed.

    Parameters

    • uri: string

      The URL for which to change an URL parameter.

    • parameterName: string

      Name of the URL parameter to change.

    • Optional parameterValue: null | string

      New value for the URL parameter. If null or not given, the empty string is used.

    Returns string

    The given URL, but with value of the given URL parameter changed to the new value.

  • requestNewClientWindowId(): void
  • Expires the current client window ID by replacing it with a temporary, invalid client window ID. Then reloads the current page to request a new ID from the server.

    Returns void

Generated using TypeDoc