com.inmethod.grid.column.editable
Class SubmitCancelColumn<M,I>

java.lang.Object
  extended by com.inmethod.grid.column.AbstractColumn<M,I>
      extended by com.inmethod.grid.column.editable.SubmitCancelColumn<M,I>
All Implemented Interfaces:
IGridColumn<M,I>, Serializable, IClusterable, IDetachable
Direct Known Subclasses:
AddDeleteColumn

public class SubmitCancelColumn<M,I>
extends AbstractColumn<M,I>

See Also:
Serialized Form

Constructor Summary
SubmitCancelColumn(String columnId, IModel<String> headerModel)
           
 
Method Summary
 boolean cellClicked(IModel<I> rowModel)
          Allows to override default behavior when a row is clicked.
protected  Icon getCancelIcon()
           
 String getCellCssClass(IModel<I> rowModel, int rowNum)
          Returns the cell specified by rowModel.
protected  Icon getSubmitIcon()
           
 Component newCell(WebMarkupContainer parent, String componentId, IModel<I> rowModel)
          Creates a new cell component.
protected  void onCancel(AjaxRequestTarget target, IModel<I> rowModel, WebMarkupContainer rowComponent)
           
protected  void onError(AjaxRequestTarget target, IModel<I> rowModel, WebMarkupContainer rowComponent)
           
protected  void onSubmitted(AjaxRequestTarget target, IModel<I> rowModel, WebMarkupContainer rowComponent)
           
 
Methods inherited from class com.inmethod.grid.column.AbstractColumn
detach, getColSpan, getGrid, getHeaderCssClass, getHeaderModel, getHeaderTooltipModel, getId, getInitialSize, getMaxSize, getMinSize, getSizeUnit, getSortProperty, getWrapText, isLightWeight, isReorderable, isResizable, newCell, newHeader, setGrid, setHeaderTooltipModel, setInitialSize, setMaxSize, setMinSize, setReorderable, setResizable, setSizeUnit, setWrapText
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SubmitCancelColumn

public SubmitCancelColumn(String columnId,
                          IModel<String> headerModel)
Method Detail

newCell

public Component newCell(WebMarkupContainer parent,
                         String componentId,
                         IModel<I> rowModel)
Description copied from class: AbstractColumn
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>
Specified by:
newCell in class AbstractColumn<M,I>
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

getSubmitIcon

protected Icon getSubmitIcon()

getCancelIcon

protected Icon getCancelIcon()

onCancel

protected void onCancel(AjaxRequestTarget target,
                        IModel<I> rowModel,
                        WebMarkupContainer rowComponent)

onError

protected void onError(AjaxRequestTarget target,
                       IModel<I> rowModel,
                       WebMarkupContainer rowComponent)

onSubmitted

protected void onSubmitted(AjaxRequestTarget target,
                           IModel<I> rowModel,
                           WebMarkupContainer rowComponent)

cellClicked

public boolean cellClicked(IModel<I> rowModel)
Description copied from class: AbstractColumn
Allows to override default behavior when a row is clicked. Depending on grid settings the default behavior can select the item. If this method returns true the default behavior will be suppressed.

Specified by:
cellClicked in interface IGridColumn<M,I>
Overrides:
cellClicked in class AbstractColumn<M,I>
Parameters:
rowModel - Model for clicked row
Returns:
true if the default behavior when row is clicked should be supressed, false otherwise.

getCellCssClass

public String getCellCssClass(IModel<I> rowModel,
                              int rowNum)
Description copied from class: AbstractColumn
Returns the cell specified by rowModel. The class is applied to the appropriate <td> element in the grid.

Specified by:
getCellCssClass in interface IGridColumn<M,I>
Overrides:
getCellCssClass in class AbstractColumn<M,I>
Parameters:
rowModel - model for given row
rowNum - index of row for DataGrid, -1 for TreeGrid
Returns:
cell style class or null


Copyright © 2007-2012 inMethod s.r.o.. All Rights Reserved.