...
- Separation of the form model from the layout
- Keeping the transient changes directly in Vaadin fields, avoiding attempts to replicate JCR session across requests (aka JCRNodeAdapter)
- Implementation of the complex fields (composites, multi-fields etc) based
...
- based on the form/editor concept
- Vaadin 8 powered implementation
Image Added
Code Pro |
---|
language | java |
---|
title | EditorDefinition |
---|
|
public interface EditorDefinition<T> extends ViewDefinition<EditorView<T>> {
} |
Code Pro |
---|
language | java |
---|
title | EditorView |
---|
|
/**
* Base interface of an editor.
*/
public interface EditorView<T> extends UiFrameworkView {
void populate(T item);
void write(T item);
List<BinderValidationStatus<?>> validate();
} |
Code Pro |
---|
language | java |
---|
title | FormDefinition |
---|
|
public interface FormDefinition<T> extends EditorDefinition<T> {
List<EditorPropertyDefinition> getProperties();
LayoutDefinition getLayout();
...
} |
Comments on the structure:
- The only thing base
EditorDefinition
enforces is that the related view is an editor view to extend interface EditorView
- The latter does not enforce any particular structure of the implementation, just basic data-binding capabilities
FormDefinition
and the related FormView
are an extension of the editor concept. Form assumes the presence of the properties and the layout definition.- The
EditorPropertyDefinition
is either a 'simple' FieldDefinition
or a ComplexPropertyDefinition
which is a some form of editor view definition plus the definition of the strategy of obtaining the child item/node the complex field to bind to.
Code Pro |
---|
language | java |
---|
title | ItemProviderStrategy |
---|
|
public interface ItemProviderStrategy<T> {
Optional<T> read();
}
|