Class EditorRenderer<T>
java.lang.Object
com.vaadin.flow.data.renderer.Renderer<T>
com.vaadin.flow.component.grid.editor.EditorRenderer<T>
- Type Parameters:
T- the type of the object being processed
- All Implemented Interfaces:
DataGenerator<T>,Serializable
Renderer and DataGenerator used by
Grid.Column to control the state of the
editor components.
Components are created during the generateData(Object, ObjectNode)
calls, and the proper data is sent to the client-side to be rendered.
- Author:
- Vaadin Ltd.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionEditorRenderer(Editor<T> editor, String columnInternalId) Creates a new renderer for a specific column. -
Method Summary
Modifier and TypeMethodDescriptionvoidgenerateData(T item, tools.jackson.databind.node.ObjectNode jsonObject) Adds custom data for the given item to its serializedObjectNoderepresentation.voidrefreshData(T item) Informs theDataGeneratorthat a data object has been updated.render(Element container, DataKeyMapper<T> keyMapper, String rendererName) Registers a renderer function with the given name to the given container element.voidsetComponentFunction(SerializableFunction<T, ? extends Component> componentFunction) Sets the function that creates components to be used as editors for the column.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.vaadin.flow.data.provider.DataGenerator
destroyAllData, destroyData
-
Constructor Details
-
EditorRenderer
Creates a new renderer for a specific column.- Parameters:
editor- the Grid's editorcolumnInternalId- the internal Id of the column that uses this data generator
-
-
Method Details
-
setComponentFunction
Sets the function that creates components to be used as editors for the column. When set tonull, an empty component is used instead.- Parameters:
componentFunction- the function that generates editor components
-
generateData
Description copied from interface:DataGeneratorAdds custom data for the given item to its serializedObjectNoderepresentation. This JSON object will be sent to client-side DataProvider.- Specified by:
generateDatain interfaceDataGenerator<T>- Parameters:
item- the data item being serializedjsonObject- the JSON object being sent to the client
-
refreshData
Description copied from interface:DataGeneratorInforms theDataGeneratorthat a data object has been updated. This method should update any unneeded information stored for given item.- Specified by:
refreshDatain interfaceDataGenerator<T>- Parameters:
item- the updated item
-
render
Description copied from class:RendererRegisters a renderer function with the given name to the given container element. Creates the setup to handle rendering of individual data items as requested by the renderer function invocation.- Specified by:
renderin classRenderer<T>- Parameters:
container- the element which accepts the renderer function on the client.keyMapper- mapper used internally to fetch items by key and to provide keys for given items.rendererName- name of the renderer function the container element accepts- Returns:
- the context of the rendering, that can be used by the components to provide extra customization
-