Interface Focusable.FocusJs

All Superinterfaces:
Serializable
Enclosing interface:
Focusable<T extends Component>

@JsDefinition public static interface Focusable.FocusJs extends Serializable
The client-side operations behind Focusable, as a JavaScript definition for Element.executeJs(Class).

Focus and blur are marked as server-initiated for the client, so that the resulting event reports isFromClient() == false. A driver of the client side that implements this interface instead of running the scripts is responsible for the same.

  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Removes focus from the element.
    void
    focus(@Nullable tools.jackson.databind.node.ObjectNode options)
    Focuses the element.
  • Method Details

    • focus

      @JsExpression("setTimeout(() => {\n try {\n this._nextFocusIsFromClient = false;\n this.focus($0);\n } finally {\n this._nextFocusIsFromClient = true;\n }\n}, 0)\n") void focus(@Nullable tools.jackson.databind.node.ObjectNode options)
      Focuses the element.
      Parameters:
      options - the options of the browser's focus function, or null for its defaults, which is what the browser makes of an empty set of options
    • blur

      @JsExpression("setTimeout(() => {\n try {\n this._nextBlurIsFromClient = false;\n this.blur();\n } finally {\n this._nextBlurIsFromClient = true;\n }\n}, 0)\n") void blur()
      Removes focus from the element.