Uses of Annotation Interface
com.vaadin.flow.js.JsExpression
Packages that use JsExpression
Package
Description
Server-side access to the browser's clipboard ? both writing (copy) and
reading (paste).
Server-side access to the browser's Screen Orientation API for observing and
locking the device's screen orientation.
Trigger API and its internal wiring.
Server-side access to the browser's Screen Wake Lock API, which keeps the
device screen from dimming or locking ? useful for dashboards, kiosks,
presentations, and recipe or workout screens.
-
Uses of JsExpression in com.vaadin.base.devserver.hotswap
Methods in com.vaadin.base.devserver.hotswap with annotations of type JsExpressionModifier and TypeMethodDescriptionvoidHotswapper.RefreshUiJs.refresh(boolean fullRefresh) Asks the dev tools to refresh the UI. -
Uses of JsExpression in com.vaadin.flow.component
Methods in com.vaadin.flow.component with annotations of type JsExpressionModifier and TypeMethodDescriptionvoidFocusable.FocusJs.blur()Removes focus from the element.voidFocusable.FocusJs.focus(@Nullable tools.jackson.databind.node.ObjectNode options) Focuses the element.ClickNotifier.ClickFiltersJs.isClickCountBetween(int min, int max) Accepts a click whose click count, thedetailof the event, is within the given range.ShortcutRegistration.ShortcutFilterJs.matchKeydown(String requiredModifiers, String forbiddenModifiers, boolean checkOwnerScope, String ownerSelector, boolean preventDefault, boolean stopPropagation, boolean resetFocus, String... keys) Creates the filter forDomListenerRegistration.setFilterExpression(DomEventFilter)that passes a keydown that matches the given key and modifiers.voidUI.UiJs.navigateToClient(String clientRoute) Hands a route to the client side router, which navigates to it without asking the server first.voidShortcutRegistration.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.voidUI.UiJs.setDirection(String direction) Sets the direction the document is read in. -
Uses of JsExpression in com.vaadin.flow.component.clipboard
Methods in com.vaadin.flow.component.clipboard with annotations of type JsExpressionModifier and TypeMethodDescriptionClipboard.PasteJs.isOutsideEditableField()A filter that passes a paste only when it does not target a form field: aninput, atextareaor an editable element.Clipboard.PasteJs.readClipboardData(String mimeType) Event data that reads the pasted data of a MIME type.Clipboard.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 JsExpression in com.vaadin.flow.component.dnd.internal
Methods in com.vaadin.flow.component.dnd.internal with annotations of type JsExpressionModifier and TypeMethodDescriptionvoidDndUtil.DndJs.setDragImage(Component dragImage, int offsetX, int offsetY) Sets the image shown while the element is dragged.voidDndUtil.DndJs.updateDragSource()Activates the element as a drag source, or deactivates it when it is no longer draggable.voidDndUtil.DndJs.updateDropTarget()Activates the element as a drop target, or deactivates it when it no longer accepts a drop. -
Uses of JsExpression in com.vaadin.flow.component.html
Methods in com.vaadin.flow.component.html with annotations of type JsExpressionModifier and TypeMethodDescriptionvoidIFrame.ReloadJs.reload()Reloads the frame by assigning its address to itself, which is what makes a browser fetch it again. -
Uses of JsExpression in com.vaadin.flow.component.internal
Methods in com.vaadin.flow.component.internal with annotations of type JsExpressionModifier and TypeMethodDescriptionWebPushJs.getSubscription()Reads the push subscription of the service worker.Declares the function that loads a chunk, forPage.addDynamicImport(JsFunction).WebPushJs.notificationDenied()Checks whether notifications are denied.WebPushJs.notificationGranted()Checks whether notifications are granted.WebPushJs.registrationStatus()Checks whether the service worker has a push subscription.Sets the title of the page.UIInternals.TitleJs.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.Asks for the notification permission and subscribes to web push.WebPushJs.unsubscribe()Removes the push subscription of the service worker. -
Uses of JsExpression in com.vaadin.flow.component.page
Methods in com.vaadin.flow.component.page with annotations of type JsExpressionModifier and TypeMethodDescriptionvoidHistory.HistoryJs.back()Goes back one entry, as the back button of the browser does.voidRemoves every value of a storage.voidHistory.HistoryJs.forward()Goes forward one entry, as the forward button of the browser does.Page.PageJs.getHref()The address the browser is at.Reads the value of a key.voidHistory.HistoryJs.go(int steps) Goes the given number of entries forward, or backward for a negative number.voidHistory.HistoryJs.navigatePushing(tools.jackson.databind.node.BaseJsonNode state, String url, boolean callback) Hands the address to the client side router, which pushes the history entry itself once it has navigated.voidHistory.HistoryJs.navigateReplacing(tools.jackson.databind.node.BaseJsonNode state, String url, boolean callback) Hands the address to the client side router, which replaces the current history entry once it has navigated.voidOpens a URL in the window with the given name, after telling the client that a redirect is pending.voidPushes a history entry, for an application whose client side router does not write one itself.ExtendedClientDetails.ClientDetailsJs.readDetails()Reads what the browser reports about itself, which is the same set of values the bootstrap collects.Page.PageJs.readDirection()Reads the direction the document is read in.voidPage.PageJs.reload()Loads the page again.voidWebStorage.WebStorageJs.removeItem(String storage, String key) Removes the value of a key.voidHistory.HistoryJs.replaceState(tools.jackson.databind.node.BaseJsonNode state, String url) Replaces the current history entry, for an application whose client side router does not write one itself.voidPage.PageJs.resetColorScheme()Lets the document follow the color scheme the user asked the browser for.voidPage.PageJs.setColorScheme(String theme, String colorScheme) Pins the document to a color scheme.voidWrites a value. -
Uses of JsExpression in com.vaadin.flow.component.screenorientation
Methods in com.vaadin.flow.component.screenorientation with annotations of type JsExpressionModifier and TypeMethodDescriptionLocks the screen to the given orientation.ScreenOrientation.ScreenOrientationJs.unlock()Lets the screen follow the device again. -
Uses of JsExpression in com.vaadin.flow.component.trigger.internal
Methods in com.vaadin.flow.component.trigger.internal with annotations of type JsExpressionModifier 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.voidSignalInput.MirrorJs.setProperty(String propertyName, Object value) Writes the value of the signal to the property the trigger reads.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 JsExpression in com.vaadin.flow.component.wakelock
Methods in com.vaadin.flow.component.wakelock with annotations of type JsExpression -
Uses of JsExpression in com.vaadin.flow.component.webcomponent
Methods in com.vaadin.flow.component.webcomponent with annotations of type JsExpressionModifier and TypeMethodDescriptionvoidWebComponent.CustomEventJs.fireEvent(String eventName, tools.jackson.databind.node.ObjectNode options) Fires an event on the host of the web component.voidWebComponentUI.ThemeAttributesJs.setAttributes(String tag, tools.jackson.databind.node.ObjectNode attributes) Sets the given attributes on every element of the given tag. -
Uses of JsExpression in com.vaadin.flow.dom
Methods in com.vaadin.flow.dom with annotations of type JsExpressionModifier and TypeMethodDescriptionElement.CallFunctionJs.callFunction(String functionName, Object... arguments) Calls the named function on the element, with the element asthisof a plain name and the property it is read from asthisof a dotted one, which is how a function reached through a property is called in JavaScript.voidElement.ElementJs.flashClass(String className) Adds the CSS class to the element and removes it again when the animation it starts has ended.voidElement.ElementJs.forwardWindowResize()Dispatches awindow-resizeevent on the element whenever the browser window is resized, with the new browser window width and height (the viewport size, excluding scrollbars) as itswandhproperties, so that a resize can be listened to on the element.voidElement.ScrollIntoViewJs.scrollIntoView()Scrolls the element into view the way the browser does by default, deferred so that it also works on an element that was created in the same response.voidElement.ScrollIntoViewJs.scrollIntoView(tools.jackson.databind.node.ObjectNode options) Scrolls the element into view with the given options, deferred so that it also works on an element that was created in the same response. -
Uses of JsExpression in com.vaadin.flow.dom.impl
Methods in com.vaadin.flow.dom.impl with annotations of type JsExpressionModifier and TypeMethodDescriptionvoidAbstractNodeStateProvider.AttachExistingElementJs.attachExistingElement(Node<?> parent, Element previousSibling, String tagName, int id) Looks for an element with the given tag name among the children of the parent, after the previous sibling, and reports the outcome to the server for the node with the given id.voidElementJsInitializerRegistration.InitializerJs.dispose(int initializerId) Calls the cleanup function that the initializer with the given id registered, if any.voidElementJsInitializerRegistration.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. -
Uses of JsExpression in com.vaadin.flow.router
Methods in com.vaadin.flow.router with annotations of type JsExpressionModifier and TypeMethodDescriptionvoidAbstractRouteNotFoundError.CopilotJs.reportNoRoutes()Tells Copilot that the project has no routes yet, waiting for it to load rather than assuming it already has. -
Uses of JsExpression in com.vaadin.flow.server.communication
Methods in com.vaadin.flow.server.communication with annotations of type JsExpressionModifier and TypeMethodDescriptionvoidWebComponentBootstrapHandler.StylesheetJs.addStylesheet(String href) Adds a stylesheet link to the head of the document.voidPushes the given hash onto the location the browser is at, for a v7 UIDL that named no location to go with it.voidUidlRequestHandler.MprPushStateJs.pushLocation(String location) Pushes the given location, which the v7 UIDL gave in full. -
Uses of JsExpression in com.vaadin.flow.server.communication.rpc
Methods in com.vaadin.flow.server.communication.rpc with annotations of type JsExpressionModifier and TypeMethodDescriptionvoidPublishedServerEventHandlerRpcHandler.PromiseJs.reject(int promiseId) Settles the promise with the failure of the method, which threw rather than returned.voidSettles the promise with what the method returned.