Annotation Interface JsWithExecutionContext


@Documented @Target(METHOD) @Retention(RUNTIME) public @interface JsWithExecutionContext
Marks a method declaring JavaScript that needs the client-side execution context of the application, which an expression passed to executeJs(String, Object...) runs against as this.

The generated function takes the context as a leading parameter named $executionContext, followed by the arguments of the call as $0, $1, …, and this stays the element the definition was obtained from. The context carries the framework callbacks, such as stopApplication() and attachExistingElement(parent, previousSibling, tagName, id), which a function of the bundle otherwise has no way to reach.

Whether a function gets the context is decided by the bundle: the build registers a marked method apart from the others, so a message from the server can not ask for the context to be given to any other function.

For internal use only. The context exposes the internals of the client, which are not an API. May be renamed or removed in any release.

Since:
25.4