com.vaadin.client.widget.grid
Interface EditorHandler<T>

Type Parameters:
T - the row data type

public interface EditorHandler<T>

An interface for binding widgets and data to the grid row editor. Used by the editor to support different row types, data sources and custom data binding mechanisms.

Since:
7.4
Author:
Vaadin Ltd

Nested Class Summary
static interface EditorHandler.EditorRequest<T>
          A request class passed as a parameter to the editor handler methods.
 
Method Summary
 void bind(EditorHandler.EditorRequest<T> request)
          Binds row data to the editor widgets.
 void cancel(EditorHandler.EditorRequest<T> request)
          Called by the editor when editing is cancelled.
 Widget getWidget(Grid.Column<?,T> column)
          Returns a widget instance that is used to edit the values in the given column.
 void save(EditorHandler.EditorRequest<T> request)
          Commits changes in the currently active edit to the data source.
 

Method Detail

bind

void bind(EditorHandler.EditorRequest<T> request)
Binds row data to the editor widgets. Called by the editor when it is opened for editing.

The implementation must call either EditorHandler.EditorRequest.success() or EditorHandler.EditorRequest.failure(String, Collection) to signal a successful or a failed (respectively) bind action.

Parameters:
request - the data binding request
See Also:
Grid.editRow(int)

cancel

void cancel(EditorHandler.EditorRequest<T> request)
Called by the editor when editing is cancelled. This method may have an empty implementation in case no special processing is required.

In contrast to bind(EditorRequest) and save(EditorRequest), any calls to EditorHandler.EditorRequest.success() or EditorHandler.EditorRequest.failure(String, Collection) have no effect on the outcome of the cancel action. The editor is already closed when this method is called.

Parameters:
request - the cancel request
See Also:
Grid.cancelEditor()

save

void save(EditorHandler.EditorRequest<T> request)
Commits changes in the currently active edit to the data source. Called by the editor when changes are saved.

The implementation must call either EditorHandler.EditorRequest.success() or EditorRequest#fail() to signal a successful or a failed (respectively) save action.

Parameters:
request - the save request
See Also:
Grid.saveEditor()

getWidget

Widget getWidget(Grid.Column<?,T> column)
Returns a widget instance that is used to edit the values in the given column. A null return value means the column is not editable.

Parameters:
column - the column whose values should be edited
Returns:
the editor widget for the column or null if the column is not editable


Copyright © 2000-2014 Vaadin Ltd. All Rights Reserved.