You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
No specific setting to enable Inline Editor is required. The editorBuffered attribute is added to XML to define whether Inline Editor must be opened in buffered mode or not, e.g:
<dataGrid editorBuffered="false"/>
Columns
To make an editable column, the editable attribute is adde to XML:
...
<column key="name" editable="true"/>
...
This setting indicates that the default Editor Component (Column#setEditorComponent()) must be set for a column by loader.
editorActionsColumn
To utilize creation of a custom column with edit buttons that invoke default Editor methods such as editItem(), save(), cancel() and closeEditor() a brand new editorActionsColumn element is introduced.
editButton - starts editing of an item. Suitable for both buffered and non buffered mode.
saveButton - saves changes made in editor components. Suitable for buffered mode only.
cancelButton - discards changes made in editor components. Suitable for buffered mode.
closeButton - closes the edit mode. Suitable for non buffered mode only.
Each button support a limited set of attributes of standard button: text, icon, title, classNames, themeNames, iconAfterText.
editorActionsColumn is added relatively to other columns. In case of includeAll="true", editorActionsColumn is added at the end.
Java
DataGridEditor
To provide additional functionality, DataGrid returns instance of DataGridEditor which extends Vaadin Grid's Editor.
Please read JavaDoc :-)
Important note: to support platform mechanisms like data containers, value sources, etc. Column Editor Component MUST be added using DataGridEditor methods (DataGridEditor#setColumnEditorComponent()) instead of direct column API Column#setEditorComponent(). For example:
To support Inline Editor buffered mode the new ValueSource implementation is created: BufferedContainerValueSource. It implements methods from BufferedDataUnit:
write()
discard()
isBuffered()
isModified()
SupportsStatusHandler
By default, field components (e.g. TextField, ComboBox, etc.) display error messages in a label above them. Such behaviour has disadvantages in case of limited area of edit cell. To be able to define different way of displaying error messages a new SupportsStatusHandler interface is created. Components that implement this interface support error handling delegation.
By default, Inline Editor uses this handler to set error message of a component as its title, e.g. tooltip.
The text was updated successfully, but these errors were encountered:
https://vaadin.com/docs/latest/components/grid/#inline-editing-java-only
Solution
XML
DataGrid
No specific setting to enable Inline Editor is required. The
editorBuffered
attribute is added to XML to define whether Inline Editor must be opened in buffered mode or not, e.g:Columns
To make an editable column, the
editable
attribute is adde to XML:This setting indicates that the default Editor Component (
Column#setEditorComponent()
) must be set for a column by loader.editorActionsColumn
To utilize creation of a custom column with edit buttons that invoke default Editor methods such as
editItem()
,save()
,cancel()
andcloseEditor()
a brand neweditorActionsColumn
element is introduced.editButton
- starts editing of an item. Suitable for both buffered and non buffered mode.saveButton
- saves changes made in editor components. Suitable for buffered mode only.cancelButton
- discards changes made in editor components. Suitable for buffered mode.closeButton
- closes the edit mode. Suitable for non buffered mode only.Each button support a limited set of attributes of standard button:
text
,icon
,title
,classNames
,themeNames
,iconAfterText
.editorActionsColumn
is added relatively to other columns. In case ofincludeAll="true"
,editorActionsColumn
is added at the end.Java
DataGridEditor
To provide additional functionality,
DataGrid
returns instance ofDataGridEditor
which extends Vaadin Grid'sEditor
.Please read JavaDoc :-)
Important note: to support platform mechanisms like data containers, value sources, etc. Column Editor Component MUST be added using
DataGridEditor
methods (DataGridEditor#setColumnEditorComponent()
) instead of direct column APIColumn#setEditorComponent()
. For example:Accompanying Changes
BufferedContainerValueSource
To support Inline Editor buffered mode the new
ValueSource
implementation is created:BufferedContainerValueSource
. It implements methods fromBufferedDataUnit
:write()
discard()
isBuffered()
isModified()
SupportsStatusHandler
By default, field components (e.g.
TextField
,ComboBox
, etc.) display error messages in a label above them. Such behaviour has disadvantages in case of limited area of edit cell. To be able to define different way of displaying error messages a newSupportsStatusHandler
interface is created. Components that implement this interface support error handling delegation.By default, Inline Editor uses this handler to set error message of a component as its title, e.g. tooltip.
The text was updated successfully, but these errors were encountered: