Flow Viritin
The commons library for Vaadin 10+. Uploads, downloads, Geolocation, forms, fieds, fluent API...
Note:
- 2.x series for Vaadin 24 (Maven central)
- 1.7.1+ for Vaadin 23.3+ (distribution via Maven central, directory repository is not necessary needed, "coordinates": in.virit:viritin)
- 0.9.0 for Vaadin 22+ (distribution via Maven central, directory repository is not necessary needed, "coordinates": in.virit:viritin)
- 0.4.0 for Vaadin 14
Flow Viritin continues with the same mission as Viritin with earlier Vaadin version. Let's add small handy components and Java API extensions to put all Vaadin developers to Flow.
Feature summary (not a complete list):
Fluent API wrappers for most vaadin-core components
"V" prefixed components provide most core APIs are available with a version that returns the component itself. These methods typically start with "with" instead of "set". This allows configuration of objects e.g. in field declaration or without declaring an extra variable. When used in appropriate places, this can produce more concise and readable code.
Uploads & Download like they should be
- UploadFileHandler aka Upload component with a proper Java API.
- Simply passes the input stream for you to handle, no weird Vaadin specific APIs
- Read/handle the contents while it is being uploaded, also works with Spring Boot
- Throttles amount of concurrent connections used, instead of choking the network
- DynamicFileDownloader for simple generation of dynamically generated file downloads. No need to buffer content in memory, but simply write it to the OutputStream, like you would do with e.g. raw Servlet API
- ByteArrayUploadField to bind a file upload to a
byte[]
field with Binder.
Access to browser API & others
- Geolocation API using a pure Java API
- BrowserCookie helper that works well with web sockets too
- LumoProps, Java enumeration for easier discoverability (& redefining/using) of the handy Lumo theme css properties.
WebStorage helper to save data in the browsers localStorage or sessionStorage(available for backwards compatibility, but the same implementation found in core as well these days)
VGrid
- Fluent API configuring like with other Viritin components
- Supports Java
record
s - CellFormatter to modify all "raw data cells" columns or based on column details.
Forms & Fields
- AbstractForm, configures binder properly for naming convention based binding and provides basic for features such as save and cancel buttons that enable themselves based on the user actions.
- CommaSeparatedStringField to edit List with Binder
- SubListSelector to pick a List from a large set of Ts with Binder (note, no re-ordering yet).
- DeleteButton, shows confirm dialog and is styled so that one don't accidentally click it
- Tree component to visualise hierarchical structures
- EnumSelect
- ElementCollectionField a field to edit e.g. List type structure
LocalDateTimeField for editing LocalDateTime objects with BinderUse DateTimePicker from core, that is available these days.
Uncategorised helpers
- RichText component to easily show Html or Markdown formatted text. Online demo
- Traditional paging with PagingGrid. Online demo
- CustomLayout component (renders raw html superfast, while you can still place Vaadin components inside it)
- BorderLayout (like in ~ Swing, implemented with CSS Grid)
- A generic MainLayout suitable for many small to medium sized projects, based on the AppLayout and SideNave components. Populates your views to the menu automatically and this way removes a ton of boilerplate code of your app.
- TreeTable. Like TreeGrid in the core, but with much easier API to populate items. Also properly supports lazy loading and scrolling to given item without extra hacks.
- ResizeObserver, Java API for similarly named JS API. Handy way to detect the size( and react to changes) of any UI component for devices optimal configuration.
Documentation
The test directory contains usage examples for components. Some components have decent JavaDocs. An actual manual would be great and an easy way to contribute back if you find the helpers useful.
Contributing
Yes please! TIP: Check the project out alongside your app project and create handy helpers directly to Viritin. Send in pull requests and join the effort!
Mirjan Merruko and Stefan Freude are so far the most active contributors to this great tool.
Links
Compatibility
Was this helpful? Need more help?
Leave a comment or a question below. You can also join
the chat on Discord or
ask questions on StackOverflow.
Version
NewFeaturesAndBugFixes
- Released
- 2019-08-22
- Maturity
- EXPERIMENTAL
- License
- Apache License 2.0
Compatibility
- Framework
- Vaadin 13+
- Vaadin 24 in 2.9.4
- Vaadin 23 in 1.7.4
- Vaadin 19+ in 0.9.0
- Vaadin 21+ in 0.7.0
- Vaadin 18+ in 0.5.0
- Vaadin 14+ in 0.5.1
- Vaadin 10+ in 0.1.8
- Browser
- N/A
Flow Viritin - Vaadin Add-on Directory
The commons library for Vaadin 10+. Uploads, downloads, Geolocation, forms, fieds, fluent API...GitHub
Online Demo
Flow Viritin version 0.1.6
ByteArrayUploadField, UploadFileHandler, DynamicFileDownloader
Flow Viritin version 0.1.7
Introduced BorderLayout
Flow Viritin version 0.2.3
NewFeaturesAndBugFixes
Flow Viritin version 0.2.4
NewFeaturesAndBugFixes
Flow Viritin version 0.2.8
See github timeline for changes
Flow Viritin version 0.2.10
Fixed several issues that were broken with V14. Updated dependencies.
Flow Viritin version 0.2.9
Added DisclosurePanel that was forgotten to commit to last release.
Flow Viritin version 0.3.0
Tree component added
Flow Viritin version 0.3.1
Updates to the Tree component
Flow Viritin version 0.5.0
Version for non-LTS branch, mainly V19+
Flow Viritin version 0.5.1
Added simple "application framework" bulk UIs.
Flow Viritin version 0.5.2
Added missing css file for app framework
Flow Viritin version 0.7.0
Lot of enhancements and new features
* first draft of ElementCollecitonField (for Flow). Consider this still WIP
* Greatly improved ByteArrayUploadField
* Ton of other small improvements
Flow Viritin version 0.9.0
Some bugfixes and release via Maven Central
New Maven coordinates!!
in.virit:viritin:0.9.0
Flow Viritin version 1.2.0
Added WebStorage helper for localStorage/sessionStorage handling.
Flow Viritin version 1.3.0
Sane defaults for date pickers via locale
Flow Viritin version 1.5.0
Added Geolocation API support
Flow Viritin version 1.6.0
Added CustomLayout component
Flow Viritin version 1.6.1
bugix in dynamicfiledownload
Flow Viritin version 2.1.0
Improvements to work better with the "dev-bundle" in Vaadin 24+. Technically so that custom bundle is no more needed when using Viritin -> front-end build don't become any slower when dropping in this add-on.
Flow Viritin version 2.5.0
Completely renewed UploadFileHandler component
* No extra thread created for each upload. For apps having a lot of large uploads concurrently, this might save some resources.
* Streaming now properly works in Spring Boot apps as well (doesn't use multipart request at all)
* Not extending from com.vaadin.flow.component.upload.Upload anymore, some API might be missing, please file issus for things you are missing
Flow Viritin version 2.5.1
Completely renewed UploadFileHandler component in 2.5.x series:
* The good old API that passes the [input stream for you to handle](https://vaadin.com/blog/uploads-and-downloads-inputs-and-outputs).
* No extra thread created for each upload. For apps having a lot of large uploads concurrently, this might save some resources.
* Streaming now properly works in Spring Boot apps as well (doesn't use multipart request at all). With previous version and with plain Upload you only get to access the stream once it is uploaded completely.
* The clients side opens maximum 1 server connection by default when allowing multiple files to be uploaded. This way the network/server/http2 connection don't get choked if uploading a large number of files at once.
* Not extending from com.vaadin.flow.component.upload.Upload anymore, some API might be missing, please file issus for things you are missing