Interface UIInternals.TitleJs

All Superinterfaces:
Serializable
Enclosing class:
UIInternals

@JsDefinition public static interface UIInternals.TitleJs extends Serializable
How the title of the page is set, as a JavaScript definition for Page.executeJs(Class).

For internal use only. May be renamed or removed in a future release.

Since:
25.4
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
    What setting the title does, shared by the plain call and the one that waits for the navigation.
  • Method Summary

    Modifier and Type
    Method
    Description
    Sets the title of the page.
    Sets the title of the page once the client side router has finished navigating, so that the title of the page it navigated away from is not the one that sticks.
  • Field Details

    • SET_TITLE

      static final String SET_TITLE
      What setting the title does, shared by the plain call and the one that waits for the navigation. The indentation ends up inside the body of the function the bundle carries, where JavaScript ignores it.
      See Also:
  • Method Details

    • setTitle

      @JsExpression(" document.title = $0;\n if(window?.Vaadin?.documentTitleSignal) {\n window.Vaadin.documentTitleSignal.value = $0;\n }\n") PendingJavaScriptResult setTitle(String title)
      Sets the title of the page.
      Parameters:
      title - the title to set
      Returns:
      the pending result, which is what cancels the update when a later one replaces it
    • setTitleAfterNavigation

      @JsExpression("if(window.Vaadin.Flow.navigation) { window.addEventListener(\'vaadin-navigated\', function(event) { document.title = $0;\n if(window?.Vaadin?.documentTitleSignal) {\n window.Vaadin.documentTitleSignal.value = $0;\n }\n}, {once:true}); } else { document.title = $0;\n if(window?.Vaadin?.documentTitleSignal) {\n window.Vaadin.documentTitleSignal.value = $0;\n }\n }") PendingJavaScriptResult setTitleAfterNavigation(String title)
      Sets the title of the page once the client side router has finished navigating, so that the title of the page it navigated away from is not the one that sticks.
      Parameters:
      title - the title to set
      Returns:
      the pending result, which is what cancels the update when a later one replaces it