Deprecated API
Contents
-
Terminally Deprecated ElementsElementDescriptionuse
ActionButton.setPreUiAction(Runnable)insteadUse the nowadays available Details component from Vaadin core instead.Vaadin ships with a built-in component these days.Vaadin 25.2 ships a native equivalent,com.vaadin.flow.component.geolocation.Geolocation. Prefer it:Geolocation.watchPosition(component)returns aGeolocationWatcherthat is bound to the component and auto-stopped on detach (no manualGeolocation.cancel()), and it offers a one-shotgetPosition(...), aGeolocationOptions.builder()and Signal-based reads. Note the migration is not drop-in: position data is exposed as a record (position.coords().longitude()) instead of getters.Part of the deprecatedGeolocationhelper. Use the nativecom.vaadin.flow.component.geolocation.GeolocationCoordinatesrecord (record accessors likelongitude()instead of getters).Part of the deprecatedGeolocationhelper. Use the nativecom.vaadin.flow.component.geolocation.Geolocationerror API (error.debugInfo()/error.errorCode()).Part of the deprecatedGeolocationhelper. Use the nativecom.vaadin.flow.component.geolocation.GeolocationPosition.Part of the deprecatedGeolocationhelper. Use the nativecom.vaadin.flow.component.geolocation.GeolocationOptions(built viaGeolocationOptions.builder()).use promptString insteaduse promptString insteaduse promptString insteadVaadin 25.2 ships a native clipboard API,com.vaadin.flow.component.clipboard.Clipboard, which handles the browser's user-gesture (transient activation) requirement correctly by arming the action on a click:Clipboard.onClick(component)returns a binding withwriteText(...)/readText(...).Vaadin 25.2 ships a native clipboard API,com.vaadin.flow.component.clipboard.Clipboard. Instead of a ready-made button, arm anyClickNotifierwithClipboard.onClick(button).writeText(value, onSuccess, onError). Note the action must be armed once at construction (not from inside anaddClickListener), so the privileged write runs within the browser's user-gesture window.Vaadin 25.2 ships a native clipboard API,com.vaadin.flow.component.clipboard.Clipboard. Instead of a ready-made button, arm anyClickNotifierwithClipboard.onClick(button).readText(consumer, errorConsumer). It also offersClipboard.onPaste(...)for server-side Ctrl+V handling.Vaadin 25.2 ships a native fullscreen API,com.vaadin.flow.component.fullscreen.Fullscreen. Arm entering withFullscreen.onClick(component).enter(component)(once at construction, within the user-gesture window), exit any time withFullscreen.exit(), and observe state viaFullscreen.stateSignal()instead of the asyncFullScreen.isFullscreen()future.Part of the deprecatedFullScreenhelper. Use the nativecom.vaadin.flow.component.fullscreen.Fullscreenand observe state changes viaFullscreen.stateSignal().Vaadin core should support everything this does these days.Vaadin 25.2 exposes page visibility natively viaUI.getCurrent().getPage().pageVisibilitySignal(), aSignal<PageVisibility>. A singleSignal.effect(component, ...)readingsignal.get()replaces bothPageVisibility.isVisible()andPageVisibility.addVisibilityChangeListener(PageVisibilityListener), and is component-bound so no manualRegistrationcleanup is needed. MapPageVisibility.Visibility.VISIBLEtocom.vaadin.flow.component.page.PageVisibility.VISIBLE.UsePageVisibilityfrom Vaadin 25.2 instead.UseResizeObserver.SizeChangeEvent.getWidth()instead. This method has a typo in the name.Vaadin 25.2 ships a native equivalent,WakeLock. Prefer it:WakeLock.request()/WakeLock.release()plusWakeLock.activeSignal()(aSignal<Boolean>that flips to false automatically when the browser releases the lock) replace theCompletableFuture+ release-listener +ScreenWakeLock.checkState()combo.WakeLock.availabilitySignal()provides feature detection.Vaadin 25.2 ships a native Web Share API,com.vaadin.flow.component.webshare.WebShare. Arm sharing withWebShare.onClick(button).share(content, onSuccess, onError)(once at construction, within the user-gesture window) and build the payload withShareContent.create().title(..).text(..).url(..); feature detection is viaWebShare.supportSignal().Migration caveat: this Viritin
Sharehas a built-in fallback for browsers without the API (notably Firefox desktop), configurable viaShare.setFirefoxFallbackNotification(Runnable). The nativeWebSharehas no built-in fallback — you must handle theUNSUPPORTEDcase yourself viaWebShare.supportSignal()so the fallback behavior is not silently lost.Part of the deprecatedSharehelper. Usecom.vaadin.flow.component.webshare.ShareContentfrom Vaadin 25.2 instead.Available as pretty much such in Vaadin core.
-
Deprecated ClassesClassDescriptionThis component only supports the Lumo theme. Vaadin 25.1+ provides a native Badge component that works with all themes. Will be removed in next major.Early version of this class, there might still be some backwards incompatible changes. Please provide your feedback, even if this "just works".Use the nowadays available Details component from Vaadin core instead.Vaadin ships with a built-in component these days.handle with care, very little tested and should be considered experimental at this point. API will most likely change, but feedback is more than welcome.Vaadin 25.2 ships a native equivalent,
com.vaadin.flow.component.geolocation.Geolocation. Prefer it:Geolocation.watchPosition(component)returns aGeolocationWatcherthat is bound to the component and auto-stopped on detach (no manualGeolocation.cancel()), and it offers a one-shotgetPosition(...), aGeolocationOptions.builder()and Signal-based reads. Note the migration is not drop-in: position data is exposed as a record (position.coords().longitude()) instead of getters.Part of the deprecatedGeolocationhelper. Use the nativecom.vaadin.flow.component.geolocation.GeolocationCoordinatesrecord (record accessors likelongitude()instead of getters).Part of the deprecatedGeolocationhelper. Use the nativecom.vaadin.flow.component.geolocation.Geolocationerror API (error.debugInfo()/error.errorCode()).Part of the deprecatedGeolocationhelper. Use the nativecom.vaadin.flow.component.geolocation.GeolocationOptions(built viaGeolocationOptions.builder()).Vaadin 25.2 ships a native clipboard API,com.vaadin.flow.component.clipboard.Clipboard, which handles the browser's user-gesture (transient activation) requirement correctly by arming the action on a click:Clipboard.onClick(component)returns a binding withwriteText(...)/readText(...).Vaadin 25.2 ships a native clipboard API,com.vaadin.flow.component.clipboard.Clipboard. Instead of a ready-made button, arm anyClickNotifierwithClipboard.onClick(button).writeText(value, onSuccess, onError). Note the action must be armed once at construction (not from inside anaddClickListener), so the privileged write runs within the browser's user-gesture window.Vaadin 25.2 ships a native clipboard API,com.vaadin.flow.component.clipboard.Clipboard. Instead of a ready-made button, arm anyClickNotifierwithClipboard.onClick(button).readText(consumer, errorConsumer). It also offersClipboard.onPaste(...)for server-side Ctrl+V handling.Vaadin 25.2 ships a native fullscreen API,com.vaadin.flow.component.fullscreen.Fullscreen. Arm entering withFullscreen.onClick(component).enter(component)(once at construction, within the user-gesture window), exit any time withFullscreen.exit(), and observe state viaFullscreen.stateSignal()instead of the asyncFullScreen.isFullscreen()future.Part of the deprecatedFullScreenhelper. Use the nativecom.vaadin.flow.component.fullscreen.Fullscreenand observe state changes viaFullscreen.stateSignal().Vaadin core should support everything this does these days.Vaadin 25.2 exposes page visibility natively viaUI.getCurrent().getPage().pageVisibilitySignal(), aSignal<PageVisibility>. A singleSignal.effect(component, ...)readingsignal.get()replaces bothPageVisibility.isVisible()andPageVisibility.addVisibilityChangeListener(PageVisibilityListener), and is component-bound so no manualRegistrationcleanup is needed. MapPageVisibility.Visibility.VISIBLEtocom.vaadin.flow.component.page.PageVisibility.VISIBLE.Vaadin 25.2 ships a native equivalent,WakeLock. Prefer it:WakeLock.request()/WakeLock.release()plusWakeLock.activeSignal()(aSignal<Boolean>that flips to false automatically when the browser releases the lock) replace theCompletableFuture+ release-listener +ScreenWakeLock.checkState()combo.WakeLock.availabilitySignal()provides feature detection.Vaadin 25.2 ships a native Web Share API,com.vaadin.flow.component.webshare.WebShare. Arm sharing withWebShare.onClick(button).share(content, onSuccess, onError)(once at construction, within the user-gesture window) and build the payload withShareContent.create().title(..).text(..).url(..); feature detection is viaWebShare.supportSignal().Migration caveat: this Viritin
Sharehas a built-in fallback for browsers without the API (notably Firefox desktop), configurable viaShare.setFirefoxFallbackNotification(Runnable). The nativeWebSharehas no built-in fallback — you must handle theUNSUPPORTEDcase yourself viaWebShare.supportSignal()so the fallback behavior is not silently lost.Available as pretty much such in Vaadin core.
-
Deprecated Enum ClassesEnum ClassDescriptionUse
PageVisibilityfrom Vaadin 25.2 instead.
-
Deprecated Record ClassesRecord ClassDescriptionPart of the deprecated
Geolocationhelper. Use the nativecom.vaadin.flow.component.geolocation.GeolocationPosition.Part of the deprecatedSharehelper. Usecom.vaadin.flow.component.webshare.ShareContentfrom Vaadin 25.2 instead.
-
Deprecated MethodsMethodDescriptionuse
ActionButton.setPostUiAction(Consumer)insteaduseActionButton.setPreUiAction(Runnable)insteadconsider using the better typed versionCssGrid.setTemplateAreas(Row...)provide FileNameGenerator insteadNote, with lazy loaded content, calling this method may cause performance issuesearly testing of this approach in couple of apps.Warning, using this method directly easily creates excessive memory usage, consider passing inContentProviderin the constructor, which postpones the content creation to a moment when actually needed.might return null if text not set with setRichTextAndSaveReference method.use getSafelist insteadWhitelist is not serializable. Override getWhitelist instead if you need to support serialiazationHelper to move from TreeGrid usage, in case the TreeData (from Vaadin core) happens to be used to describe the hierarchy.This is currently very little tested feature. Please provide all feedback you can if there are issues, so that I can improve this.This is currently very little tested feature.Hoping to get this feature to the core soon, there might be API conflicts at that point. Use the lower levelResizeObserverdirectly if you are concerned about potential future API conflicts.use coords(), getter left for backwards compatiblity (changed to record)use timestamp(), getter left for backwards compatiblity (changed to record)use promptString insteaduse promptString insteaduse promptString insteadConsider usingFullScreen.requestFullscreen(Component)instead. See implementation notes inFullScreen.requestFullscreen(Component)for more information.Requesting full screen for a specific element may have limitations in the current Vaadin version. Consider usingFullScreen.requestFullscreen(Component)instead.UseResizeObserver.SizeChangeEvent.getWidth()instead. This method has a typo in the name.Badge is not supported by Firefox and Safari, so it is not recommended to use.Icon is not supported by Safari, so it is not recommended to use.Only supported by Chromium-based browsersRenotify is not supported by Firefox and Safari, so it is not recommended to use.Require interaction is not supported by Firefox and Safari, so it is not recommended to use.Tag is not supported by Safari, so it is not recommended to use.Timestamp is not supported by Firefox and Safari, so it is not recommended to use.Vibration is not supported by Firefox and Safari, so it is not recommended to use.
-
Deprecated ConstructorsConstructorDescriptionconsider using some of the better typed versionuse the better typed versions insteadUse the versions with proper icon typing insteadconsider using some of the better typed versionuse the better typed versions insteadUse the versions with proper icon typing insteadUse the versions with better typed icon insteadnot sure yet if this is a good idea, added for backwards compatibility