summaryrefslogtreecommitdiffstats
path: root/documentation/components/components-customfield.asciidoc
diff options
context:
space:
mode:
authorMarkus Koivisto <markus@vaadin.com>2016-01-22 14:55:18 +0200
committerMarkus Koivisto <markus@vaadin.com>2016-01-22 14:55:18 +0200
commit99d6de546c74f0eed230ea8253dda6b85109d2e7 (patch)
tree10fc21c557566fe3241e6e13499df18d80f8dcb2 /documentation/components/components-customfield.asciidoc
parent610736d9f373d4b37fd39ff8f90aabd13eab7926 (diff)
downloadvaadin-framework-99d6de546c74f0eed230ea8253dda6b85109d2e7.tar.gz
vaadin-framework-99d6de546c74f0eed230ea8253dda6b85109d2e7.zip
Add documentation to master branch
Change-Id: I2504bb10f1ae73ec0cbc08b7ba5a88925caa1674
Diffstat (limited to 'documentation/components/components-customfield.asciidoc')
-rw-r--r--documentation/components/components-customfield.asciidoc33
1 files changed, 33 insertions, 0 deletions
diff --git a/documentation/components/components-customfield.asciidoc b/documentation/components/components-customfield.asciidoc
new file mode 100644
index 0000000000..f57eb2debf
--- /dev/null
+++ b/documentation/components/components-customfield.asciidoc
@@ -0,0 +1,33 @@
+---
+title: Composite Fields with CustomField
+order: 32
+layout: page
+---
+
+[[components.customfield]]
+= Composite Fields with [classname]#CustomField#
+
+The [classname]#CustomField# is a way to create composite components like with
+[classname]#CustomComponent#, except that it implements the
+[interfacename]#Field# interface and inherit [classname]#AbstractField#,
+described in
+<<dummy/../../../framework/components/components-fields#components.fields,"Field
+Components">>. A field allows editing a property value in the Vaadin data model,
+and can be bound to data with field groups, as described in
+<<dummy/../../../framework/datamodel/datamodel-itembinding#datamodel.itembinding,"Creating
+Forms by Binding Fields to Items">>. The field values are buffered and can be
+validated with validators.
+
+A composite field class must implement the [methodname]#getType()# and
+[methodname]#initContent()# methods. The latter should return the content
+composite of the field. It is typically a layout component, but can be any
+component.
+
+It is also possible to override [methodname]#validate()#,
+[methodname]#setInternalValue()#, [methodname]#commit()#,
+[methodname]#setPropertyDataSource#, [methodname]#isEmpty()# and other methods
+to implement different functionalities in the field. Methods overriding
+[methodname]#setInternalValue()# should call the superclass method.
+
+
+