Class EditorRenderer<T>

java.lang.Object
com.vaadin.flow.data.renderer.Renderer<T>
io.jmix.groupgridflowui.kit.vaadin.grid.editor.EditorRenderer<T>
Type Parameters:
T - the type of the object being processed
All Implemented Interfaces:
com.vaadin.flow.data.provider.DataGenerator<T>, Serializable

public class EditorRenderer<T> extends com.vaadin.flow.data.renderer.Renderer<T> implements com.vaadin.flow.data.provider.DataGenerator<T>
Renderer and DataGenerator used by Grid.Column to control the state of the editor components.

Components are created during the generateData(Object, JsonObject) calls, and the proper data is sent to the client-side to be rendered.

See Also:
  • Constructor Summary

    Constructors
    Constructor
    Description
    EditorRenderer(Editor<T> editor, String columnInternalId)
    Creates a new renderer for a specific column.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    generateData(T item, elemental.json.JsonObject jsonObject)
     
    void
    refreshData(T item)
     
    com.vaadin.flow.data.renderer.Rendering<T>
    render(com.vaadin.flow.dom.Element container, com.vaadin.flow.data.provider.DataKeyMapper<T> keyMapper, String rendererName)
     
    void
    setComponentFunction(com.vaadin.flow.function.SerializableFunction<T,? extends com.vaadin.flow.component.Component> componentFunction)
    Sets the function that creates components to be used as editors for the column.

    Methods inherited from class com.vaadin.flow.data.renderer.Renderer

    render

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface com.vaadin.flow.data.provider.DataGenerator

    destroyAllData, destroyData
  • Constructor Details

    • EditorRenderer

      public EditorRenderer(Editor<T> editor, String columnInternalId)
      Creates a new renderer for a specific column.
      Parameters:
      editor - the Grid's editor
      columnInternalId - the internal Id of the column that uses this data generator
  • Method Details

    • setComponentFunction

      public void setComponentFunction(com.vaadin.flow.function.SerializableFunction<T,? extends com.vaadin.flow.component.Component> componentFunction)
      Sets the function that creates components to be used as editors for the column. When set to null, an empty component is used instead.
      Parameters:
      componentFunction - the function that generates editor components
    • generateData

      public void generateData(T item, elemental.json.JsonObject jsonObject)
      Specified by:
      generateData in interface com.vaadin.flow.data.provider.DataGenerator<T>
    • refreshData

      public void refreshData(T item)
      Specified by:
      refreshData in interface com.vaadin.flow.data.provider.DataGenerator<T>
    • render

      public com.vaadin.flow.data.renderer.Rendering<T> render(com.vaadin.flow.dom.Element container, com.vaadin.flow.data.provider.DataKeyMapper<T> keyMapper, String rendererName)
      Specified by:
      render in class com.vaadin.flow.data.renderer.Renderer<T>