Viritin
What apache-commons and Guava libraries does for Java, Viritin does it for Vaadin
Note, this add-on is available also for Vaadin versions 10+
Viritin is a server side enhancement library for Vaadin. It fixes some bad defaults in the core framework and provides more fluent and intelligent API for existing components. It also provides several major enhancements to databinding and provides completely new components made with server side composition (no widgetset is needed).
- Better typed API for Table, Grid and various select components, easier to get started, better readability, safer refactoring. Endorsing java.util.collections and basic Java beans over proprietary Container-Item-Property.
- Enhanced developer experience with extended basic layouts
- Lots of handy Field implementations e.g. for common relation types (@ManyToMany, @OneToMany, @ElementCollection in JPA terminology, but not tied to JPA)
- AbstractForm - a base class to avoid boilerplate code for basic entity editing
- Enhancements to core Fields and BeanFieldGroup, better defaults, enhanced end user UX with on the fly validation
- Setting browser cookies from basic Java code
- Really scalable "lazy loading" solutions for Vaadin Components (see MTable, LazyComboBox, ListContainer + LazyList)
- Often needed component compositions: PrimaryButton, ConfirmButton, DisclosurePanel ...
- Cross-field validation support
- Improved input fields
- Support for custom HTML5 input properties (autocomplete, autocorrect...)
- IntegerField (numeric keyboard on mobile devices, only accepts numbers, type of the field is Integer)
- DoubleField
- EmailField (email keyboard on mobile devices)
There is already a huge set of enhancements, couple of them are highlighted below. For a more complete view of what is provided, check out the project page in github for more details listing of examples. There is always room for enhancements and the project is easy to check out for development, so join the effort in github!
Sample code
MTable<Entity> t = new MTable(findBeans()) .withProperties("property", "another") .withColumnHeaders("Property 1", "Second"); t.addMValueChangeListener(new MValueChangeListener<Entity>() { @Override public void valueChange(MValueChangeEvent<Entity> event) { editEntity(event.getValue()); } });
// with Viritin setContent(new MVerticalLayout(new MHorizontalLayout(c, d).withFullWidth()) .expand(new MHorizontalLayout(menu).expand(mainContent))); // same without Viritin VerticalLayout wrapper = new VerticalLayout(); wrapper.setMargin(true); wrapper.setSpacing(true); wrapper.setHeight("100%"); HorizontalLayout toolbar = new HorizontalLayout(c, d); toolbar.setWidth("100%"); toolbar.setMargin(false); toolbar.setSpacing(true); HorizontalLayout wrapper2 = new HorizontalLayout(); wrapper2.addComponent(menu); wrapper2.addComponent(mainContent); wrapper2.setSizeFull(); mainContent.setSizeFull(); wrapper2.setExpandRatio(mainContent, 1); wrapper.addComponents(toolbar, wrapper2); wrapper.setExpandRatio(wrapper2, 1); setContent(wrapper);
MTable<Update> table; @Inject GPSRouteService s; @PostConstruct void init() { add(table = new MTable<>(s::fetchUpdates, s::getEntityCount)); }
Links
- Vaadin 7 compatibility package
- Viritin @ GitHub
- Full-stack example app
- Documentation (work in progress)
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
- Released
- 2016-12-29
- Maturity
- STABLE
- License
- Apache License 2.0
Compatibility
- Framework
- Vaadin 7.6+
- Vaadin 8.1+ in 2.1
- Vaadin 8.0+ in 2.14.1
- Vaadin 7.4+ in 2.12
- Vaadin 7.3+ in 1.31
- Browser
- Browser Independent
Viritin - Vaadin Add-on Directory
What apache-commons and Guava libraries does for Java, Viritin does it for VaadinViritin @ GitHub
Full-stack example app
Documentation (work in progress)
Viritin version 1.22
First release after rename from Maddon to Viritin. Contains lots of new helper for editing collection fields.
Viritin version 1.24
See github tags
Viritin version 1.26
See github changes and release tags for changes.
Viritin version 1.30
Better Grid compatibility for lazy list stuff and fixed bad states (in some situations) of action buttons in AbstractForm. and See github for more details.
Viritin version 1.31
Enhancements to element collection fields, TypedSelect, EnumSelect. See github for changeling.
Viritin version 1.32
Built against 7.4, dropping support for 7.3 series. Use 1.31 with older Vaain versions.
Viritin version 1.33
Fixed regression in 1.32 with MTable value change listeners.
Viritin version 1.34
Largish release with at least:
* Improved localisation support
* Enhancements to AbstractForm
* Cross-field validation support to MBeanFieldGroup and AbstractForm, but JSR303 and programmatic approaches supported. This feature is currently experimental.
* Refactored TypedSelect (now extends CustomField to cope with some Vaadin core issues). This may brake some classes that inherit from it but its pretty easy to fix.
See project page for full change list.
Viritin version 1.35
* Better scalability for LazyComboBox, when using Vaadin 7.5
* Group support for bean level (including cross field) validation
* Support for nested/mapped/indexed/all-combined properties in ListContainer/DynaBeanItem/MTable
* Other minor improvements
Viritin version 1.36
* First version of MGrid
* Lots of community fixes/enhancements
Viritin version 1.37
Enhancements to for example MTable (e.g. typed RowClickListener/Event) and MGrid.
See github for full change list.
Viritin version 1.38
See github timeline for changes
Viritin version 1.40
7.6 compatibility, most notably for MGrid.
Viritin version 1.41
* Null safe nested properties
* MGrid now works with SortableLazyList properly
Viritin version 1.43
* MGrid lazy loading with sortable provider is now fixed in 7.6 series
* MDateField has option the strategy how do define time for newly set dates when resolution don't allow modifying time.
Viritin version 1.44
IntegerField, IntegerSliderField and other HTML5 related enhancements
Viritin version 1.45
OSGi compatibility, EmailField, MGrid enhancements, see github timeline for more details.
Viritin version 1.46
See github project for changes
Viritin version 1.47
See github for changes
Viritin version 1.48
Highly improved LazyList, especially for Grid and 7.6 series, and lots of other improvements. See full list of chages from [github](https://github.com/viritin/viritin/commits/master).
Viritin version 1.49
Added one more workaround for Grid & Vaadin 7.6 series lazy loading issues
Viritin version 1.50
* generated column support for MGrid
* lots of other smaller improvements
See github timeline for all changes
Viritin version 1.51
See github for latest changes
Viritin version 1.52
SubSetSelector, bugfixes and enhancements. See github for full list of changes.
Viritin version 1.53
See github timeline
Viritin version 1.54
Lots of small improvements and bugfixes, see github timeline for changes.
Viritin version 1.56
See github timeline for all enhancements
Viritin version 1.59
Lots of enhancements and bug fixes! See github timeline to see all improvements.
Viritin version 2.0.alpha1
First alpha release supporting V8. Lot of V8 related support still to be implemented, but "org.viritin.v7" compatibility package should now allow projects to start converting to Vaadin 8. See [Vaadin 8 upgrade in wiki](https://github.com/viritin/viritin/wiki/Vaadin-8-upgrade) for more details.
Viritin version 2.0.alpha2
Second alpha release supporting V8. Lot of V8 related support still to be implemented, but "org.viritin.v7" compatibility package should now allow projects to start converting to Vaadin 8. See [Vaadin 8 upgrade in wiki](https://github.com/viritin/viritin/wiki/Vaadin-8-upgrade) for more details.
In this release:
* Fixed IntegerField to actually fire value change evens and this way work with Binder
* Most "fluent methods" are now implemented using Java 8 tricks and default methods. This adds a lot of missing fluent APIs and makes maintaining them much easier.
* Added a rudimentary version of AbstractForm based on Vaadin 8 Binder and HasValue interface.
See all changes from github.
Viritin version 2.0.alpha3
null
Viritin version 2.0.beta2
Bugfixes & minor features
Viritin version 2.1
This version contains some bug fixes and splits v7 packages to a separate module.
Viritin version 2.3
See github for changes
Viritin version 2.5
Bugfixes and small features. See github for details.
Viritin version 2.11
Greatly improved lazy data binding support for Grid
Viritin version 2.12
Version updates and MarkDownField
Viritin version 2.14.1
Slightly backwards incompatible release preparing for jsoup upgrade in next Vaadin version (moderate security issue)