Options
All
  • Public
  • Public/Protected
  • All
Menu

The class for the object with the AJAX utility methods, used for handling and working with AJAX requests and updates.

Hierarchy

  • Utils

Index

Methods

  • getContent(node: HTMLElement): string
  • Iterates over all immediate children of the given node and returns the concatenated content (node value) of each such child node. For the document itself, the node value is null. For text, comment, and CDATA nodes, the node value is the (text) content of the node. For attribute nodes, the value of the attribute is used.

    Parameters

    • node: HTMLElement

      An HTML node for which to retrieve the content.

    Returns string

    The content of all immediate child nodes, concatenated together.

  • getPorletForms(form: JQuery<HTMLElement>, parameterPrefix: string): null | string
  • Gets a selector to resolve all forms which needs to be updated with a new ViewState. This is required in portlets as the DOM contains forms of multiple JSF views / applications.

    Parameters

    • form: JQuery<HTMLElement>

      The closest form of the request source.

    • parameterPrefix: string

      The portlet parameter prefix.

    Returns null | string

    The selector for the forms, or null when no forms need to be updated.

  • getPostUrl(form: JQuery<HTMLElement>): string
  • Resolves the URL which should be used for the POST request. For portlets, a different URL is used.

    Parameters

    • form: JQuery<HTMLElement>

      The closest form of the request source.

    Returns string

    The POST url.

  • Get source ID from settings.

    Parameters

    Returns string

    The source ID from settings or null if settings does not contain a source.

  • isAjaxRequest(script: string): boolean
  • Is this script an AJAX request?

    Parameters

    • script: string

      the JS script to check

    Returns boolean

    true if this script contains an AJAX request

  • Checks whether the component ID from the provided widget equals the source ID from the provided settings.

    Parameters

    Returns boolean

    true if the component ID from the provided widget equals the source ID from the provided settings.

  • Checks whether one of component's triggers equals the source ID from the provided settings.

    Parameters

    • widget: BaseWidget<BaseWidgetCfg>

      of the component to check for being the source.

    • settings: AjaxSettings<any>

      containing source ID.

    • triggerMustExist: boolean

      flag to check if the trigger must exist

    Returns boolean

    true if if one of component's triggers equals the source ID from the provided settings.

  • updateBody(content: string): void
  • Updates the HTML body element of the current document with the content received from an AJAX request.

    Parameters

    • content: string

      The content of the changeset that was returned by an AJAX request.

    Returns void

  • Updates an element with the given ID by applying a change set that was returned by an AJAX request. This involves replacing the HTML content of the element with the new content.

    Parameters

    • id: string

      ID of the element that is to be updated.

    • content: string

      The new content of the changeset as returned by an AJAX request.

    • Optional xhr: pfXHR<PrimeFacesArgs>

      Optional XHR request with pfSettings or pfArgs with further data, such as which forms should be updated.

    Returns void

  • Updates the main hidden input element for each form.

    Parameters

    • name: string

      Name of the hidden form input element, usually the same as the form.

    • value: string

      Value to set on the hidden input element.

    • Optional xhr: pfXHR<PrimeFacesArgs>

      Optional XHR request with pfSettings or pfArgs with further data, such as which forms should be updated.

    Returns void

  • updateHead(content: string): void
  • Updates the HTML head element of the current document with the content received from an AJAX request.

    Parameters

    • content: string

      The content of the changeset that was returned by an AJAX request.

    Returns void

Generated using TypeDoc