Class AbstractLightWeightColumn<M,​I,​S>

    • Constructor Detail

      • AbstractLightWeightColumn

        public AbstractLightWeightColumn​(String columnId,
                                         IModel<String> headerModel,
                                         S sortProperty)
        Creates instance with specified column id, header model and sort property.
        Parameters:
        columnId - column identifier - must be unique within the grid
        headerModel - model for column title
        sortProperty - optional string that will be returned by ISortState to indicate that the column is being sorted
      • AbstractLightWeightColumn

        public AbstractLightWeightColumn​(String columnId,
                                         IModel<String> headerModel)
        Creates instance with specified column id and header model
        Parameters:
        columnId - column identifier - must be unique within the grid
        headerModel - model for column title
    • Method Detail

      • isLightWeight

        public boolean isLightWeight​(IModel<I> rowModel)
        Returns whether this column is uses a component for cell in given row (not lightweight) or an IRenderable implementation. Generally, if the cell is non-interactive (label only), it's better to use an IRenderable implementation, as it has zero memory footprint
        Specified by:
        isLightWeight in interface IGridColumn<M,​I,​S>
        Overrides:
        isLightWeight in class AbstractColumn<M,​I,​S>
        Parameters:
        rowModel - model for given row
        Returns:
        true if the cell is lightweight, false otherwise
      • newCell

        public Component newCell​(WebMarkupContainer parent,
                                 String componentId,
                                 IModel<I> rowModel)
        Creates a new cell component. This method is called for rows that are not lightweight ( IGridColumn.isLightWeight(IModel) returns false ).
        Specified by:
        newCell in interface IGridColumn<M,​I,​S>
        Specified by:
        newCell in class AbstractColumn<M,​I,​S>
        Parameters:
        parent - Parent component. This is passed in only for convenience, the method implementation is not supposed to add the newly created component to the parent.
        componentId - required id of newly created components
        rowModel - model for given row
        Returns:
        new cell component