Uses of Class
com.vaadin.flow.dom.JsFunction
Packages that use JsFunction
Package
Description
Server-side access to the browser's clipboard ? both writing (copy) and
reading (paste).
Trigger API and its internal wiring.
-
Uses of JsFunction in com.vaadin.flow.component
Methods in com.vaadin.flow.component with parameters of type JsFunctionModifier and TypeMethodDescriptionvoidShortcutRegistration.ShortcutJs.registerKeydownDelegate(JsFunction locateDelegate, String requiredModifiers, String forbiddenModifiers, boolean checkBoundary, boolean resetFocus, boolean allowDefault, String... keys) Relays the keydown events of an element that only exists in the browser to the element this definition was obtained from, the listen-on component of a shortcut.static RegistrationShortcuts.setShortcutListenOnElementLocator(JsFunction elementLocator, Component listenOnComponent) Setup an element, that is only accessible on the browser (not server side), to listen for shortcut events on and delegate to the given component. -
Uses of JsFunction in com.vaadin.flow.component.clipboard
Methods in com.vaadin.flow.component.clipboard that return JsFunctionModifier and TypeMethodDescriptionClipboard.PasteJs.uploadPastedFiles(String urlAttribute) An initializer that uploads the files of each paste on the element to the URL in the given attribute of the element, and returns the function that stops listening. -
Uses of JsFunction in com.vaadin.flow.component.internal
Methods in com.vaadin.flow.component.internal that return JsFunctionModifier and TypeMethodDescriptionDeclares the function that loads a chunk, forPage.addDynamicImport(JsFunction). -
Uses of JsFunction in com.vaadin.flow.component.page
Methods in com.vaadin.flow.component.page with parameters of type JsFunctionModifier and TypeMethodDescriptionvoidPage.addDynamicImport(JsFunction dynamicImport) Adds a dynamic import that calls the given function, which is supposed to return a JavaScriptPromise. -
Uses of JsFunction in com.vaadin.flow.component.trigger.internal
Methods in com.vaadin.flow.component.trigger.internal that return JsFunctionModifier and TypeMethodDescriptionTriggerJs.callChannel(ReturnChannelRegistration channel) An action that calls a return channel without a value.DownloadAction.DownloadJs.download(JsFunction url, @Nullable JsFunction filename) An action that downloads from the URL of an input, next to the element the event of the trigger happened on.TriggerJs.listenToEvent(JsFunction action, String eventName) An installer that runs an action whenever the element receives a DOM event with the given name.TriggerJs.observeSize(JsFunction action) An installer that runs an action with the size of the element whenever it changes, as{width, height}.OpenInNewTabAction.OpenInNewTabJs.openInNewTab(JsFunction url, JsFunction features) An action that opens the URL of an input in a new browser tab, unless it is ajavascript:URL, so that a URL produced on the client can not run script in the origin of the page.TriggerInputJs.readEventProperty(String propertyName) An input that reads a property of the event it is called with.ReadFromClipboardAction.ReadFromClipboardJs.readFromClipboard()An action that reads the clipboard.TriggerInputJs.readProperty(Element target, String propertyName) An input that reads a property of an element when it is called.TriggerJs.reportOutcome(JsFunction promise, ReturnChannelRegistration channel) An action that runs a promise-returning action and reports the outcome of the promise to a return channel, as{ok, value}when it resolves or as{ok, error: {name, message}}when it rejects.RequestFullscreenAction.RequestFullscreenJs.requestComponentFullscreen(Element target, Element wrapper) An action that requests fullscreen for an element, moving it into the wrapper element of the UI.RequestFullscreenAction.RequestFullscreenJs.requestPageFullscreen()An action that requests fullscreen for the whole page.TriggerInputJs.returnEvent()An input that returns the event it is called with.TriggerInputJs.returnNull()An input that returnsnull, for a slot that is not given an input.TriggerInputJs.returnValue(Object value) An input that returns the given value.TriggerJs.runAfterTimeout(JsFunction action, long delayMillis) An installer that runs an action once, after the given delay.TriggerJs.sendToChannel(ReturnChannelRegistration channel, JsFunction source) An action that sends the value of an input to a return channel.TriggerJs.setProperty(Element target, String propertyName, JsFunction source) An action that assigns the value of an input to a property of an element.ShareAction.ShareJs.share(@Nullable JsFunction title, @Nullable JsFunction text, @Nullable JsFunction url) An action that opens the share sheet with the values of the given inputs, leaving out each field whose input isnull.abstract JsFunctionBuilds theJsFunctionthat yields this input's value when called.protected abstract JsFunctionBuilds theJsFunctionthat runs this action when the surrounding trigger fires.protected final JsFunctionprotected JsFunctionprotected JsFunctionprotected final JsFunctionFinal by design ? subclasses customise the rendered JS throughPromiseAction.toPromiseJs(com.vaadin.flow.component.trigger.internal.Trigger), never by overriding the wiring that subscribes to the promise.protected JsFunctionprotected abstract JsFunctionPromiseAction.toPromiseJs(Trigger trigger) Subclasses return aJsFunctionthat, when invoked with the trigger's event, evaluates to aPromise.protected JsFunctionReadFromClipboardAction.toPromiseJs(Trigger trigger) protected JsFunctionRequestFullscreenAction.toPromiseJs(Trigger trigger) protected JsFunctionShareAction.toPromiseJs(Trigger trigger) protected JsFunctionWriteToClipboardAction.toPromiseJs(Trigger trigger) WriteToClipboardAction.WriteToClipboardJs.writeToClipboard(JsFunction text, JsFunction html, JsFunction image) An action that writes the values of the given inputs to the clipboard, skipping each one that returnsnull.Methods in com.vaadin.flow.component.trigger.internal with parameters of type JsFunctionModifier and TypeMethodDescriptionDownloadAction.DownloadJs.download(JsFunction url, @Nullable JsFunction filename) An action that downloads from the URL of an input, next to the element the event of the trigger happened on.protected RegistrationDomEventTrigger.install(JsFunction action) protected RegistrationSizeTrigger.install(JsFunction action) protected RegistrationTimeoutTrigger.install(JsFunction action) protected abstract RegistrationTrigger.install(JsFunction action) Installs the given rendered action as a client-side listener and returns theRegistrationthat detaches it.TriggerJs.listenToEvent(JsFunction action, String eventName) An installer that runs an action whenever the element receives a DOM event with the given name.TriggerJs.observeSize(JsFunction action) An installer that runs an action with the size of the element whenever it changes, as{width, height}.OpenInNewTabAction.OpenInNewTabJs.openInNewTab(JsFunction url, JsFunction features) An action that opens the URL of an input in a new browser tab, unless it is ajavascript:URL, so that a URL produced on the client can not run script in the origin of the page.TriggerJs.reportOutcome(JsFunction promise, ReturnChannelRegistration channel) An action that runs a promise-returning action and reports the outcome of the promise to a return channel, as{ok, value}when it resolves or as{ok, error: {name, message}}when it rejects.TriggerJs.runAfterTimeout(JsFunction action, long delayMillis) An installer that runs an action once, after the given delay.TriggerJs.sendToChannel(ReturnChannelRegistration channel, JsFunction source) An action that sends the value of an input to a return channel.TriggerJs.setProperty(Element target, String propertyName, JsFunction source) An action that assigns the value of an input to a property of an element.ShareAction.ShareJs.share(@Nullable JsFunction title, @Nullable JsFunction text, @Nullable JsFunction url) An action that opens the share sheet with the values of the given inputs, leaving out each field whose input isnull.WriteToClipboardAction.WriteToClipboardJs.writeToClipboard(JsFunction text, JsFunction html, JsFunction image) An action that writes the values of the given inputs to the clipboard, skipping each one that returnsnull. -
Uses of JsFunction in com.vaadin.flow.dom
Methods in com.vaadin.flow.dom that return JsFunctionModifier and TypeMethodDescriptionstatic JsFunctionCreates a JavaScript function value with the given body and captured parameters.static JsFunctionJsFunction.ofDeclaredCall(JsCall call) Creates the function that a call of a method of aJsDefinitioninterface declares, which the build collects into the bundle.JsFunction.withArguments(String... argumentNames) Returns a copy of this function that declares the given names as positional runtime arguments.Methods in com.vaadin.flow.dom with parameters of type JsFunctionModifier and TypeMethodDescriptionElement.addJsInitializer(JsFunction initializer) Registers a JavaScript initializer that runs in the browser each time a client-side DOM node is created for this element, and whose returned cleanup callback is invoked when that DOM node is discarded or the returned registration is removed. -
Uses of JsFunction in com.vaadin.flow.dom.impl
Methods in com.vaadin.flow.dom.impl with parameters of type JsFunctionModifier and TypeMethodDescriptionvoidElementJsInitializerRegistration.InitializerJs.init(int initializerId, JsFunction initializer) Applies the initializer to the element and registers the cleanup function it returns, to be called when the client discards the DOM node of the element or the initializer is disposed of.Constructors in com.vaadin.flow.dom.impl with parameters of type JsFunctionModifierConstructorDescriptionElementJsInitializerRegistration(StateNode node, JsFunction initializer) Creates a new registration for the given initializer and schedules the first init invocation if the node is currently attached.