com.sapportals.htmlb.table

Class TableView

java.lang.Object
  extended bycom.sapportals.htmlb.Component
      extended bycom.sapportals.htmlb.Container
          extended bycom.sapportals.htmlb.EventValidationContainer
              extended bycom.sapportals.htmlb.table.TableView
All Implemented Interfaces:
IEventValidationComponent

public class TableView
extends EventValidationContainer

New: Three generic functions have been identified and have been added to the table. Select all: Selects all rows of a table with multi selection. Deselect all: Deselects all rows of a HTMLB with multi selection. Invert Selection: the selected rows become unselected and vice versa.

To get the menu with options Select All/Deselect All/Invert Selection in the table, please use the new TableViewSelectionMode - MultiSelectionWithOptions.

The Methods for handling these events should be: onSelectAll, onDeselcetAll, onInvertSelection Note: Due to some new requirements we decided to provide row keys persistence of all rows for a table view with "multiple" or "single" selection mode. Pls be aware that it's your own responsibility to make sure that the table view should not contain too many rows. Otherwise it can cause performance problems.

Copyright 2004 SAP AG


Field Summary
protected  ArrayList columns
           
static String deselectAll
           
static String invertSelection
           
static String selectAll
           
static String tableViewOptionMenuModifier
           
static String UI_ID
           
static int VAR_BEGIN
           
static int VAR_BEGINCOLUMNHEADERS
           
static int VAR_BEGINCONTCELL
           
static int VAR_BEGINCONTENT
           
static int VAR_BEGINCONTROW
           
static int VAR_BEGINFOOTER
           
static int VAR_BEGINHEAD
           
static int VAR_BEGINHEADCELL
           
static int VAR_BEGINHEADTITLE
           
static int VAR_END
           
static int VAR_ENDCOLUMNHEADERS
           
static int VAR_ENDCONTCELL
           
static int VAR_ENDCONTENT
           
static int VAR_ENDCONTROW
           
static int VAR_ENDFOOTER
           
static int VAR_ENDHEAD
           
static int VAR_ENDHEADCELL
           
static int VAR_ENDHEADTITLE
           
static int VAR_FOOTERNAVIGATION
           
static int VAR_FOOTERPOSITION
           
 
Fields inherited from class com.sapportals.htmlb.Container
elements
 
Constructor Summary
TableView(String id)
          Constructs a table that is initialized with id as the id of the name
TableView(String id, TableViewModel tableViewModel)
          Constructs a table that is initialized with tableViewModel as the data model
 
Method Summary
 void addKeyColumn(int columnIndex)
          adds the column at columnIndex as a key column
 String encodeInternalData()
          encodes the column names and the row keys, internal use only
 String getAccessibilityDescription()
          get the semantical description of the component in it's applicationcontext used by screenreaders
 CellHAlign getCellHAlignment(int rowIndex, int columnIndex)
          returns the horizontal alignment for the cell at rowIndex and columnIndex
 ICellRenderer getCellRenderer(int row, int column)
          returns the table cell renderer for the given column and row
 TableColumnType getCellType(int rowIndex, int columnIndex)
          returns the display type for the cell at rowIndex and columnIndex
 CellVAlign getCellVAlignment(int rowIndex, int columnIndex)
          returns the vertical alignment for the cell at rowIndex and columnIndex
 int getColspanForCell(int rowIndex, int columnIndex)
          returns the colspan for the cell at rowIndex and columnIndex
 int getColspanForCurrentColumn()
          returns the colspan for the current column Note: internal use only.
 TableColumn getColumn(int columnIndex)
          returns the column at columnIndex
 TableColumn getColumn(String columnKey)
          returns the column with the id columnKey
 int getColumnCount()
          returns the column count of the table
 String getColumnName(int columnIndex)
          returns the column identifier of the column at columnIndex
 Vector getColumns()
          returns the visible columns of the table
 TableColumnType getColumnType(int columnIndex)
          returns the type of the column
 String getComponentIdModifier()
          get a String that is specific for the component class that is added as modifier to the component ID returned by Form.getFullIdForComponent();
 int getCurrentColumnIndex()
          returns the current column index Note: internal use only.
 int getCurrentPageIndex()
          returns the page index Note: Internal use only
 int getCurrentRowIndex()
          returns the current row index Note: internal use only.
 TableViewDesign getDesign()
          returns the table design
 String getEmptyTableText()
          returns the text that should be displayed if the table is empty
 EventModifierData getEventModifierData()
          get a String that is specific for the component class that is added as modifier data to any event fired from within this components scope.
 IFooterRenderer getFooterRenderer()
          returns the footer renderer for the table
 String getFormId()
          returns the form id
 IHeaderCellRenderer getHeaderCellRenderer(int column)
          returns the table header cell renderer for the table for the given column
 IHeaderRenderer getHeaderRenderer()
          returns the table header renderer for the table.
 String getHeaderText()
          returns the title of the table
 TableViewModel getModel()
          returns the table model
 TableNavigationMode getNavigationMode()
          returns the navigation mode for the table
 String getOnClientRowSelection()
          returns the event handler for the row client side selection event The handler for the rowselection event will be returned if there is one given.
 String getOnDeselectAll()
          returns the event handler for deselect all event in the option menu
 String getOnHeaderClick()
          returns the name of the event handler for the header click event
 String getOnInvertSelection()
          returns the event handler for invert selection event in the option menu
 String getOnNavigate()
          returns the name of the event handler for the navigation event
 String getOnRowSelection()
          returns the event handler for the row selection event The handler for the rowselection event should be returned if there is one given.
 String getOnSelectAll()
          returns the event handler for select all event in the option menu
 HoverMenu getOptionMenu(Locale locale)
           
 int getRowCount()
          returns the number of rows of the table
 String getRowDescription(int row)
          sets the sematical description for the component in it's applicationcontext used by screenreaders
 String getRowKey(int rowIndex)
          returns the content in the key column at rowIndex if there was no key column set, the rowIndex will be returned
 IRowRenderer getRowRenderer(int rowIndex)
          returns the table row renderer for the given row index
 int getRowspanForCell(int rowIndex, int columnIndex)
          returns the rowspan for the cell at rowIndex and columnIndex
 TableSelectionMode getSelectionMode()
          returns the selection mode for the table
 SpanInfo getSpanInfoForCell(int rowIndex, int columnIndex)
          returns the span info for the cell at rowIndex and columnIndex
 TableCellStyle getStyleForCell(int rowIndex, int columnIndex)
          returns the style for the cell at rowIndex and columnIndex
 String getSummary()
          returns the summary
 CellHAlign getTableHAlignment()
          get the halign for the whole table
 Toolbar getToolbar()
          get the toolbar for the TableView
 String getUI()
          returns the UI of the table
 AbstractDataType getValueAt(int row, int column)
          returns the value at row and column
 AbstractDataType getValueAt(int row, String columnName)
          returns the value at row and in the column with columnName
 int getVisibleFirstRow()
          returns the index of the first visible row
 int getVisibleLastRow()
          returns the index of the last visible row on the page
 int getVisibleRowCount()
          returns the count of the visible rows
 String getWidth()
          returns the width of the table
protected  void initFromPageContext(IPageContext pc, String baseId)
          inits the component from page context.
 boolean isCellDisabled(int rowIndex, int columnIndex)
          returns if the component in a cell should be disabled or not Note: currently supported component is: InputField
 boolean isCellHeaderVisible()
          determines if the cell header row is visible or not
 boolean isCellInvalid(int rowIndex, int columnIndex)
          returns if the component in a cell contains a invalid value or not Note: currently supported component is: InputField
 boolean isFillUpEmptyRows()
          returns if the table should be filled up with the empty rows
 boolean isFooterVisible()
          returns if the footer is visible
 boolean isHeaderCellWrapping()
          check if the header cell of the column should be wrappend or not
 boolean isHeaderVisible()
          checks if the header of the table should be visible or not
 boolean isRowSelectable(int rowIndex)
          checks the checkbox or radiobutton for the row at rowIndex can be selected.
 boolean isRowSelected(int rowIndex)
          returns true if a row is selected.
 void prepareSpanInfoBuffer()
          prepares the span info buffer for rendering.
 void selectRow(int rowIndex, boolean isSelected)
          checks the checkbox or radiobutton for the row at rowIndex if the TableSelectionMode is set to TableSelectionMode.MULTISELECT or TableSelectionMode.SINGLESELECT Note: you can deselect one row using this method with parameter isSelected=false
 void setAccessibilityDescription(String accessibilityDescription)
          sets the sematical description for the component in it's applicationcontext used by screenreaders
 void setCellDisabled(int rowIndex, int columnIndex, boolean disabled)
          sets this component in the cell to disabled or enabled Note: current supported component is: InputField
 void setCellHAlignment(int rowIndex, int columnIndex, CellHAlign hAlignment)
          sets the horizontal alignment for the cell at rowIndex and columnIndex
 void setCellHeaderVisible(boolean cellHeaderVisible)
          sets cell header row visible or not Note: this method only displays/hides the title of the columns.
 void setCellInvalid(int rowIndex, int columnIndex, boolean invalid)
          sets this component in the cell to invalid Note: current supported component is: InputField
 void setCellRenderer(ICellRenderer tableCellRenderer)
          sets the cellrenderer for the table
 void setCellType(int rowIndex, int columnIndex, TableColumnType type)
          sets the display type for the cell at rowIndex and columnIndex
 void setCellVAlignment(int rowIndex, int columnIndex, CellVAlign vAlignment)
          sets the vertical alignment for the cell at rowIndex and columnIndex
 void setColspanForCell(int rowIndex, int columnIndex, int colspan)
          sets the colspan for the cell at rowIndex and columnIndex
 void setColspanForCurrentColumn(int colspanForCurrentColumn)
          sets the colspan for the current column Note: internal use only.
 void setColumnAt(TableColumn column, int columnIndex)
          sets the column for the table at column with the columnIndex
 void setColumnCount(int columnCount)
          sets the column count of the table
 void setColumnHAlignment(int columnIndex, CellHAlign hAlignment)
          sets the horizontal alignment for the column at columnIndex
 void setColumnInvisible(String columnKey)
          sets a column invisible
 void setColumnName(String columnName, int columnIndex)
          sets the name(title) of the column named with columnName
 void setColumnType(TableColumnType columnType, int columnIndex)
          sets the type of the column
 void setColumnVAlignment(int columnIndex, CellVAlign vAlignment)
          sets the vertical alignment for the whole column at columnIndex
 void setCurrentColumnIndex(int currentColumnIndex)
          sets the current column index Note: Internal use only.
 void setCurrentRowIndex(int currentRowIndex)
          sets the current row index Note: internal use only.
 void setDesign(TableViewDesign design)
          sets the table design
 void setEmptyTableText(String emptyTableText)
          sets the text that should be displayed if the table has no content
 void setFillUpEmptyRows(boolean fillUpEmptyRows)
           
 void setFooterRenderer(IFooterRenderer footerRenderer)
          sets the footer renderer for the table
 void setFooterVisible(boolean footerVisible)
          sets footer visible or not
 void setHeaderCellRenderer(IHeaderCellRenderer headerCellRenderer)
          sets the headerCellRenderer for the table Note: the headerCellRenderer simply renders the title of each single column of the table.
 void setHeaderCellWrapping(boolean headerCellWrapping)
          determines if the header cell of the table should be wrapped
 void setHeaderRenderer(IHeaderRenderer headerRenderer)
          sets the table header renderer for the table
 void setHeaderText(String headerText)
          sets the title of the table
 void setHeaderVisible(boolean headerVisible)
          sets the visibility of the table header Note: this method only displays/hides the title of the table.
 void setKeyColumn(int columnIndex)
          sets the column at columnIndex as the key column
 void setLinkColumnKey(String linkRefColumnName, int columnIndex)
          sets the reference column for a link column
 void setLinkColumnKey(String linkRefColumnName, String columnName)
          sets the reference column for a link column
 void setModel(TableViewModel tableViewModel)
          sets the table model
 void setNavigationMode(TableNavigationMode navigationMode)
          sets the navigation mode for the table
 void setOnCellClick(int columnIndex, String onCellClick)
          sets the event handler for all cells in a column
 void setOnCellClick(String columnKey, String onCellClick)
          sets the event handler for all cells in a column
 void setOnClientCellClick(int columnIndex, String onClientCellClick)
          sets the event handler for the client side cell click event
 void setOnClientCellClick(String columnKey, String onClientCellClick)
          sets the event handler for the client side cell click event
 void setOnClientRowSelection(String onClientRowSelection)
          sets the event handler for the client side row selection event
 void setOnDeselectAll(String onDeselectAll)
          sets the event handler for deselect all event in the option menu
 void setOnHeaderClick(String onHeaderClick)
          sets the event handler for table header click event
 void setOnInvertSelection(String onInvertSelection)
          sets the event handler for revert selection event in the option menu
 void setOnNavigate(String onNavigate)
          sets the event handler for table navigation event
 void setOnRowSelection(String onRowSelection)
          sets the event handler for the row selection event This method can be used to fire a TableRowSelectionEvent if a radiobutton in the selection column of the table with the single selection mode is selected.
 void setOnSelectAll(String onSelectAll)
          sets the event handler for select all event in the option menu
 void setRowCount(int rowCount)
          sets the number of rows of the table
 void setRowDescription(String accessibilityDescription, int row)
          sets the sematical description for the component in it's applicationcontext used by screenreaders
 void setRowRenderer(IRowRenderer tableRowRenderer)
          sets the tableRowRenderer variable
 void setRowSelectable(int rowIndex, boolean selectable)
          sets if the checkbox or radiobutton for the row at rowIndex can be selected.
 void setRowSelection(int rowIndex)
          Deprecated. replaced by
 void setRowspanForCell(int rowIndex, int columnIndex, int rowspan)
          sets the rowspan for the cell at rowIndex and columnIndex
 void setRowVAlignment(int rowIndex, CellVAlign vAlignment)
          sets the vertical alignment for the column at rowIndex
 void setSelectionMode(TableSelectionMode selectionMode)
          sets the selection mode for the table
 void setStyleForCell(int rowIndex, int columnIndex, TableCellStyle style)
          sets the style for the cell at rowIndex and columnIndex
 void setSummary(String summary)
          sets the summary
 void setTableHAlignment(CellHAlign tableHAlignment)
          sets halign for the whole table
 void setToolbar(Toolbar toolbar)
          set a toolbar for the TableView
 void setUserTypeCellRenderer(ICellRenderer userTypeCellRenderer)
          sets the cell renderer for user defiend type
 void setVisibleFirstRow(int visibleFirstRow)
          sets the index of the first visible row
 void setVisibleRowCount(int visibleRowCount)
          sets the number of the rows of the visible rows
 void setWidth(String width)
          sets the width of the table
 void useRowSelection(TableView table)
          select the rows in this table, using the same indexes of the rows which were selected in the table.
 
Methods inherited from class com.sapportals.htmlb.EventValidationContainer
getAllValidators, getClientEvent, getClientEventMap, getErrorText, getServerEvent, getServerEventMap, getValidator, isDisabled, isEnabled, isRequiresValidation, renderJavascriptInterface, setClientEvent, setDisabled, setEnabled, setErrorText, setServerEvent, setValidator
 
Methods inherited from class com.sapportals.htmlb.Container
addComponent, addRawText, addText, getChildCount, iterator, preRender, removeComponent, render
 
Methods inherited from class com.sapportals.htmlb.Component
getEncodedIdForForm, getId, getParent, initFromShortId, initializeFromId, isJsObjectNeeded, render, renderAsString, requiresForm, setId, setJsObjectNeeded, setParent
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

UI_ID

public static final String UI_ID
See Also:
Constant Field Values

VAR_BEGIN

public static final int VAR_BEGIN
See Also:
Constant Field Values

VAR_BEGINHEAD

public static final int VAR_BEGINHEAD
See Also:
Constant Field Values

VAR_BEGINHEADCELL

public static final int VAR_BEGINHEADCELL
See Also:
Constant Field Values

VAR_ENDHEADCELL

public static final int VAR_ENDHEADCELL
See Also:
Constant Field Values

VAR_ENDHEAD

public static final int VAR_ENDHEAD
See Also:
Constant Field Values

VAR_BEGINCONTENT

public static final int VAR_BEGINCONTENT
See Also:
Constant Field Values

VAR_BEGINCONTROW

public static final int VAR_BEGINCONTROW
See Also:
Constant Field Values

VAR_BEGINCONTCELL

public static final int VAR_BEGINCONTCELL
See Also:
Constant Field Values

VAR_ENDCONTCELL

public static final int VAR_ENDCONTCELL
See Also:
Constant Field Values

VAR_ENDCONTROW

public static final int VAR_ENDCONTROW
See Also:
Constant Field Values

VAR_ENDCONTENT

public static final int VAR_ENDCONTENT
See Also:
Constant Field Values

VAR_BEGINFOOTER

public static final int VAR_BEGINFOOTER
See Also:
Constant Field Values

VAR_FOOTERNAVIGATION

public static final int VAR_FOOTERNAVIGATION
See Also:
Constant Field Values

VAR_FOOTERPOSITION

public static final int VAR_FOOTERPOSITION
See Also:
Constant Field Values

VAR_ENDFOOTER

public static final int VAR_ENDFOOTER
See Also:
Constant Field Values

VAR_END

public static final int VAR_END
See Also:
Constant Field Values

VAR_BEGINHEADTITLE

public static final int VAR_BEGINHEADTITLE
See Also:
Constant Field Values

VAR_ENDHEADTITLE

public static final int VAR_ENDHEADTITLE
See Also:
Constant Field Values

VAR_BEGINCOLUMNHEADERS

public static final int VAR_BEGINCOLUMNHEADERS
See Also:
Constant Field Values

VAR_ENDCOLUMNHEADERS

public static final int VAR_ENDCOLUMNHEADERS
See Also:
Constant Field Values

selectAll

public static final String selectAll
See Also:
Constant Field Values

deselectAll

public static final String deselectAll
See Also:
Constant Field Values

invertSelection

public static final String invertSelection
See Also:
Constant Field Values

tableViewOptionMenuModifier

public static final String tableViewOptionMenuModifier
See Also:
Constant Field Values

columns

protected ArrayList columns
Constructor Detail

TableView

public TableView(String id)
Constructs a table that is initialized with id as the id of the name

Parameters:
id - the id of the table

TableView

public TableView(String id,
                 TableViewModel tableViewModel)
Constructs a table that is initialized with tableViewModel as the data model

Parameters:
id - the id of the table
tableViewModel - the model of the table
See Also:
TableViewModel
Method Detail

getUI

public String getUI()
returns the UI of the table

Specified by:
getUI in class Component
Returns:
a unique identification string for this Component

getRowRenderer

public IRowRenderer getRowRenderer(int rowIndex)
returns the table row renderer for the given row index

Parameters:
rowIndex - the row index

setRowRenderer

public void setRowRenderer(IRowRenderer tableRowRenderer)
sets the tableRowRenderer variable

Parameters:
tableRowRenderer - the row renderer for the table

getCellRenderer

public ICellRenderer getCellRenderer(int row,
                                     int column)
returns the table cell renderer for the given column and row

Parameters:
row - the row index
column - the column index
Returns:
cell renderer for the cell at the specified column and row

setCellRenderer

public void setCellRenderer(ICellRenderer tableCellRenderer)
sets the cellrenderer for the table

Parameters:
tableCellRenderer - the cell renderer for the table

getHeaderCellRenderer

public IHeaderCellRenderer getHeaderCellRenderer(int column)
returns the table header cell renderer for the table for the given column

Parameters:
column - the index of the column
Returns:
the renderer for the header cell

setHeaderCellRenderer

public void setHeaderCellRenderer(IHeaderCellRenderer headerCellRenderer)
sets the headerCellRenderer for the table Note: the headerCellRenderer simply renders the title of each single column of the table.

Parameters:
headerCellRenderer - the renderer for the column title

setFooterRenderer

public void setFooterRenderer(IFooterRenderer footerRenderer)
sets the footer renderer for the table


setUserTypeCellRenderer

public void setUserTypeCellRenderer(ICellRenderer userTypeCellRenderer)
sets the cell renderer for user defiend type

Parameters:
userTypeCellRenderer - user defined cell renderer

getHeaderRenderer

public IHeaderRenderer getHeaderRenderer()
returns the table header renderer for the table. The headerRenderer simply renders the header text for the whole table

Returns:
the header renderer for the table

setHeaderRenderer

public void setHeaderRenderer(IHeaderRenderer headerRenderer)
sets the table header renderer for the table

Parameters:
headerRenderer - the renderer which renders the header text of the table

getFooterRenderer

public IFooterRenderer getFooterRenderer()
returns the footer renderer for the table


getColumns

public Vector getColumns()
returns the visible columns of the table


setColumnAt

public void setColumnAt(TableColumn column,
                        int columnIndex)
sets the column for the table at column with the columnIndex

See Also:
TableColumn

getColumn

public TableColumn getColumn(int columnIndex)
returns the column at columnIndex

See Also:
TableColumn

getColumn

public TableColumn getColumn(String columnKey)
returns the column with the id columnKey

Parameters:
columnKey - the identifier of the column

getColumnName

public String getColumnName(int columnIndex)
returns the column identifier of the column at columnIndex

Parameters:
columnIndex - the index of the column whose name should be retrieved
See Also:
TableColumn

setColumnName

public void setColumnName(String columnName,
                          int columnIndex)
sets the name(title) of the column named with columnName

Parameters:
columnName - the name for the column
columnIndex - the index of the column whose name should be set

getColumnType

public TableColumnType getColumnType(int columnIndex)
returns the type of the column

Parameters:
columnIndex - the index of the column
See Also:
TableColumnType

setColumnType

public void setColumnType(TableColumnType columnType,
                          int columnIndex)
sets the type of the column


getDesign

public TableViewDesign getDesign()
returns the table design

See Also:
TableViewDesign

setDesign

public void setDesign(TableViewDesign design)
sets the table design

See Also:
TableViewDesign

getHeaderText

public String getHeaderText()
returns the title of the table


setHeaderText

public void setHeaderText(String headerText)
sets the title of the table


isFillUpEmptyRows

public boolean isFillUpEmptyRows()
returns if the table should be filled up with the empty rows


getEmptyTableText

public String getEmptyTableText()
returns the text that should be displayed if the table is empty


setEmptyTableText

public void setEmptyTableText(String emptyTableText)
sets the text that should be displayed if the table has no content


getSummary

public String getSummary()
returns the summary


setSummary

public void setSummary(String summary)
sets the summary


getTableHAlignment

public CellHAlign getTableHAlignment()
get the halign for the whole table


setTableHAlignment

public void setTableHAlignment(CellHAlign tableHAlignment)
sets halign for the whole table


setFillUpEmptyRows

public void setFillUpEmptyRows(boolean fillUpEmptyRows)

getColumnCount

public int getColumnCount()
returns the column count of the table


setColumnCount

public void setColumnCount(int columnCount)
sets the column count of the table


getRowCount

public int getRowCount()
returns the number of rows of the table


setRowCount

public void setRowCount(int rowCount)
sets the number of rows of the table


getVisibleFirstRow

public int getVisibleFirstRow()
returns the index of the first visible row


setVisibleFirstRow

public void setVisibleFirstRow(int visibleFirstRow)
sets the index of the first visible row


getVisibleRowCount

public int getVisibleRowCount()
returns the count of the visible rows


setVisibleRowCount

public void setVisibleRowCount(int visibleRowCount)
sets the number of the rows of the visible rows


isHeaderVisible

public boolean isHeaderVisible()
checks if the header of the table should be visible or not


setHeaderVisible

public void setHeaderVisible(boolean headerVisible)
sets the visibility of the table header Note: this method only displays/hides the title of the table. To hide the title of the columns, please use the method #setCellHeaderVisible(boolean)


isFooterVisible

public boolean isFooterVisible()
returns if the footer is visible


setFooterVisible

public void setFooterVisible(boolean footerVisible)
sets footer visible or not


isCellHeaderVisible

public boolean isCellHeaderVisible()
determines if the cell header row is visible or not

Returns:
true if the cell headers are visible

setCellHeaderVisible

public void setCellHeaderVisible(boolean cellHeaderVisible)
sets cell header row visible or not Note: this method only displays/hides the title of the columns. To display/hide the title of the whole table, please use the method #setHeaderVisible(boolean)

Parameters:
cellHeaderVisible - true to set the cell headers visible, false to hide cell heades.

isCellDisabled

public boolean isCellDisabled(int rowIndex,
                              int columnIndex)
returns if the component in a cell should be disabled or not Note: currently supported component is: InputField

Parameters:
rowIndex - the index of the row
columnIndex - the index of the column or -1 for setting the complete row
Returns:
if the component in the specified cell should be disabled or not

setCellDisabled

public void setCellDisabled(int rowIndex,
                            int columnIndex,
                            boolean disabled)
sets this component in the cell to disabled or enabled Note: current supported component is: InputField

Parameters:
disabled - true if the component in the cell should be disabled

isCellInvalid

public boolean isCellInvalid(int rowIndex,
                             int columnIndex)
returns if the component in a cell contains a invalid value or not Note: currently supported component is: InputField

Parameters:
rowIndex - the index of the row
columnIndex - the index of the column or -1 for setting the complete row
Returns:
if the component in the specified cell contains a invalid value or not

setCellInvalid

public void setCellInvalid(int rowIndex,
                           int columnIndex,
                           boolean invalid)
sets this component in the cell to invalid Note: current supported component is: InputField

Parameters:
rowIndex - the index of the row
columnIndex - the index of the column or -1 for setting the complete row
invalid - true if the InputField contains an invalid value

setColumnInvisible

public void setColumnInvisible(String columnKey)
sets a column invisible

Parameters:
columnKey - the key of the column

getWidth

public String getWidth()
returns the width of the table

Returns:
the width of the table

setWidth

public void setWidth(String width)
sets the width of the table

Parameters:
width - the width of the table

getModel

public TableViewModel getModel()
returns the table model


setModel

public void setModel(TableViewModel tableViewModel)
sets the table model


getValueAt

public AbstractDataType getValueAt(int row,
                                   int column)
returns the value at row and column


getValueAt

public AbstractDataType getValueAt(int row,
                                   String columnName)
returns the value at row and in the column with columnName


getVisibleLastRow

public int getVisibleLastRow()
returns the index of the last visible row on the page


getOnNavigate

public String getOnNavigate()
returns the name of the event handler for the navigation event

See Also:
TableNavigationEvent

setOnHeaderClick

public void setOnHeaderClick(String onHeaderClick)
sets the event handler for table header click event

See Also:
TableHeaderClickEvent

getOnRowSelection

public String getOnRowSelection()
returns the event handler for the row selection event The handler for the rowselection event should be returned if there is one given.


setOnRowSelection

public void setOnRowSelection(String onRowSelection)
sets the event handler for the row selection event This method can be used to fire a TableRowSelectionEvent if a radiobutton in the selection column of the table with the single selection mode is selected.

See Also:
To retrieve the index of the row from where the event is coming, pls use the method #com.sapportals.htmlb.event.TableSelectionEvent.getRowIndex()

getOnClientRowSelection

public String getOnClientRowSelection()
returns the event handler for the row client side selection event The handler for the rowselection event will be returned if there is one given.


setOnClientRowSelection

public void setOnClientRowSelection(String onClientRowSelection)
sets the event handler for the client side row selection event


setOnCellClick

public void setOnCellClick(int columnIndex,
                           String onCellClick)
sets the event handler for all cells in a column

Parameters:
columnIndex - the index of the visible column
onCellClick - the event action
See Also:
TableCellClickEvent

setOnCellClick

public void setOnCellClick(String columnKey,
                           String onCellClick)
sets the event handler for all cells in a column

Parameters:
columnKey - the key of the column
onCellClick - the event action
See Also:
TableCellClickEvent

setOnClientCellClick

public void setOnClientCellClick(int columnIndex,
                                 String onClientCellClick)
sets the event handler for the client side cell click event


setOnClientCellClick

public void setOnClientCellClick(String columnKey,
                                 String onClientCellClick)
sets the event handler for the client side cell click event


getOnHeaderClick

public String getOnHeaderClick()
returns the name of the event handler for the header click event

See Also:
TableHeaderClickEvent

setOnNavigate

public void setOnNavigate(String onNavigate)
sets the event handler for table navigation event


getNavigationMode

public TableNavigationMode getNavigationMode()
returns the navigation mode for the table

See Also:
TableNavigationMode

setNavigationMode

public void setNavigationMode(TableNavigationMode navigationMode)
sets the navigation mode for the table

See Also:
TableNavigationMode

getSelectionMode

public TableSelectionMode getSelectionMode()
returns the selection mode for the table

See Also:
TableSelectionMode

setSelectionMode

public void setSelectionMode(TableSelectionMode selectionMode)
sets the selection mode for the table

See Also:
TableSelectionMode

getFormId

public String getFormId()
returns the form id


initFromPageContext

protected void initFromPageContext(IPageContext pc,
                                   String baseId)
inits the component from page context. The encoded string incl. information like rowkeys, selected row indexes will be decoded here. Note: internal use only

Overrides:
initFromPageContext in class Component
Parameters:
pc - the context, including the parameters
baseId - the prefix used for the component. (The result of a former RenderUtil.getIdForForm(rc, c);)
See Also:
IPageContext, Component

encodeInternalData

public String encodeInternalData()
encodes the column names and the row keys, internal use only


getRowKey

public String getRowKey(int rowIndex)
returns the content in the key column at rowIndex if there was no key column set, the rowIndex will be returned


setLinkColumnKey

public void setLinkColumnKey(String linkRefColumnName,
                             int columnIndex)
sets the reference column for a link column


setLinkColumnKey

public void setLinkColumnKey(String linkRefColumnName,
                             String columnName)
sets the reference column for a link column


getCellHAlignment

public CellHAlign getCellHAlignment(int rowIndex,
                                    int columnIndex)
returns the horizontal alignment for the cell at rowIndex and columnIndex

Parameters:
rowIndex - the index of the row
columnIndex - the index of the column or -1 for setting the complete row

setCellHAlignment

public void setCellHAlignment(int rowIndex,
                              int columnIndex,
                              CellHAlign hAlignment)
sets the horizontal alignment for the cell at rowIndex and columnIndex

Parameters:
rowIndex - the index of the row or -1 for setting the complete column
columnIndex - the index of the column or -1 for setting the complete row
See Also:
CellHAlign

getCellType

public TableColumnType getCellType(int rowIndex,
                                   int columnIndex)
returns the display type for the cell at rowIndex and columnIndex

Parameters:
rowIndex - the index of the row
columnIndex - the index of the column

setCellType

public void setCellType(int rowIndex,
                        int columnIndex,
                        TableColumnType type)
sets the display type for the cell at rowIndex and columnIndex

Parameters:
rowIndex - the index of the row or -1 for setting the complete column
columnIndex - the index of the column

setColumnHAlignment

public void setColumnHAlignment(int columnIndex,
                                CellHAlign hAlignment)
sets the horizontal alignment for the column at columnIndex

Parameters:
columnIndex - the index of the column or -1 for setting the complete row

getCellVAlignment

public CellVAlign getCellVAlignment(int rowIndex,
                                    int columnIndex)
returns the vertical alignment for the cell at rowIndex and columnIndex

Parameters:
rowIndex - the index of the row
columnIndex - the index of the column
See Also:
CellVAlign

setCellVAlignment

public void setCellVAlignment(int rowIndex,
                              int columnIndex,
                              CellVAlign vAlignment)
sets the vertical alignment for the cell at rowIndex and columnIndex


setRowVAlignment

public void setRowVAlignment(int rowIndex,
                             CellVAlign vAlignment)
sets the vertical alignment for the column at rowIndex

Parameters:
rowIndex - the index of the row for setting the complete row

setColumnVAlignment

public void setColumnVAlignment(int columnIndex,
                                CellVAlign vAlignment)
sets the vertical alignment for the whole column at columnIndex

Parameters:
columnIndex - the index of the column for setting vertical alignment for the complete column

getColspanForCell

public int getColspanForCell(int rowIndex,
                             int columnIndex)
returns the colspan for the cell at rowIndex and columnIndex

Parameters:
rowIndex - the index of the row
columnIndex - the index of the column
Returns:
colspan for the specified cell

setColspanForCell

public void setColspanForCell(int rowIndex,
                              int columnIndex,
                              int colspan)
sets the colspan for the cell at rowIndex and columnIndex


getRowspanForCell

public int getRowspanForCell(int rowIndex,
                             int columnIndex)
returns the rowspan for the cell at rowIndex and columnIndex


setRowspanForCell

public void setRowspanForCell(int rowIndex,
                              int columnIndex,
                              int rowspan)
sets the rowspan for the cell at rowIndex and columnIndex

Parameters:
rowIndex - the index of the row
columnIndex - the index of the column
rowspan - the row span that the cell should have

getStyleForCell

public TableCellStyle getStyleForCell(int rowIndex,
                                      int columnIndex)
returns the style for the cell at rowIndex and columnIndex

Parameters:
rowIndex - the index of the row
columnIndex - the index of the column

setStyleForCell

public void setStyleForCell(int rowIndex,
                            int columnIndex,
                            TableCellStyle style)
sets the style for the cell at rowIndex and columnIndex

Parameters:
rowIndex - the index of the row
columnIndex - the index of the column
style - the style for the cell

setRowSelectable

public void setRowSelectable(int rowIndex,
                             boolean selectable)
sets if the checkbox or radiobutton for the row at rowIndex can be selected.


isRowSelectable

public boolean isRowSelectable(int rowIndex)
checks the checkbox or radiobutton for the row at rowIndex can be selected.


setRowSelection

public void setRowSelection(int rowIndex)
Deprecated. replaced by

checks the checkbox or radiobutton for the row at rowIndex if the TableSelectionMode is set to TableSelectionMode.MULTISELECT or TableSelectionMode.SINGLESELECT Note: the rowIndex is the absolute index of the row in the table and begins with 1


selectRow

public void selectRow(int rowIndex,
                      boolean isSelected)
checks the checkbox or radiobutton for the row at rowIndex if the TableSelectionMode is set to TableSelectionMode.MULTISELECT or TableSelectionMode.SINGLESELECT Note: you can deselect one row using this method with parameter isSelected=false

Parameters:
rowIndex - the index of the row in the table. Note: the rowIndex is the absolute index of the row in the table and begins with 1

isRowSelected

public boolean isRowSelected(int rowIndex)
returns true if a row is selected. This methode should be used to check if a specified row was selected.

Parameters:
rowIndex - the index of the row in the table. Note: the rowIndex is the absolute index of the row in the table and starts with 1

setKeyColumn

public void setKeyColumn(int columnIndex)
sets the column at columnIndex as the key column

Parameters:
columnIndex - the index of the column Note: this is the absolute index of the column in the model

addKeyColumn

public void addKeyColumn(int columnIndex)
adds the column at columnIndex as a key column

Parameters:
columnIndex - the index of the key column which is to be added

getSpanInfoForCell

public SpanInfo getSpanInfoForCell(int rowIndex,
                                   int columnIndex)
returns the span info for the cell at rowIndex and columnIndex

Parameters:
rowIndex - te index of the row
columnIndex - the index of the column
Returns:
span info

prepareSpanInfoBuffer

public void prepareSpanInfoBuffer()
prepares the span info buffer for rendering. This is necessary for rendering table with rowspan and colspan.


getEventModifierData

public EventModifierData getEventModifierData()
get a String that is specific for the component class that is added as modifier data to any event fired from within this components scope.

Returns:
a String containing arbitrary data

getComponentIdModifier

public String getComponentIdModifier()
get a String that is specific for the component class that is added as modifier to the component ID returned by Form.getFullIdForComponent();

Returns:
a String containing arbitrary modifying data

getCurrentRowIndex

public int getCurrentRowIndex()
returns the current row index Note: internal use only. Used by the class DefaultTAbleViewRenderer by rendering


setCurrentRowIndex

public void setCurrentRowIndex(int currentRowIndex)
sets the current row index Note: internal use only. Used by the class DefaultTAbleViewRenderer by rendering


getCurrentColumnIndex

public int getCurrentColumnIndex()
returns the current column index Note: internal use only. Used by the class DefaultTAbleViewRenderer by rendering


setCurrentColumnIndex

public void setCurrentColumnIndex(int currentColumnIndex)
sets the current column index Note: Internal use only. Used by the class DefaultTableViewRenderer


getColspanForCurrentColumn

public int getColspanForCurrentColumn()
returns the colspan for the current column Note: internal use only. Used by the class DefaultTableViewRenderer


setColspanForCurrentColumn

public void setColspanForCurrentColumn(int colspanForCurrentColumn)
sets the colspan for the current column Note: internal use only. Used by the class DefaultTableViewRenderer


getCurrentPageIndex

public int getCurrentPageIndex()
returns the page index Note: Internal use only


useRowSelection

public void useRowSelection(TableView table)
select the rows in this table, using the same indexes of the rows which were selected in the table.

Parameters:
table - the indexes of the selected rows in the table will be used to determine which rows of the actual table object should be (pre)selected.

getOnSelectAll

public String getOnSelectAll()
returns the event handler for select all event in the option menu


setOnSelectAll

public void setOnSelectAll(String onSelectAll)
sets the event handler for select all event in the option menu


getOnDeselectAll

public String getOnDeselectAll()
returns the event handler for deselect all event in the option menu


setOnDeselectAll

public void setOnDeselectAll(String onDeselectAll)
sets the event handler for deselect all event in the option menu


getOnInvertSelection

public String getOnInvertSelection()
returns the event handler for invert selection event in the option menu


setOnInvertSelection

public void setOnInvertSelection(String onInvertSelection)
sets the event handler for revert selection event in the option menu


getOptionMenu

public HoverMenu getOptionMenu(Locale locale)

setToolbar

public void setToolbar(Toolbar toolbar)
set a toolbar for the TableView

Parameters:
toolbar - the Toolbar

getToolbar

public Toolbar getToolbar()
get the toolbar for the TableView

Returns:
the toolbar

isHeaderCellWrapping

public boolean isHeaderCellWrapping()
check if the header cell of the column should be wrappend or not

Returns:
if the header cell should be wrapped

setHeaderCellWrapping

public void setHeaderCellWrapping(boolean headerCellWrapping)
determines if the header cell of the table should be wrapped

Parameters:
headerCellWrapping - boolean parameter which determines the wrapping of the header cell of the whole table

getAccessibilityDescription

public String getAccessibilityDescription()
get the semantical description of the component in it's applicationcontext used by screenreaders

Returns:
description text

setAccessibilityDescription

public void setAccessibilityDescription(String accessibilityDescription)
sets the sematical description for the component in it's applicationcontext used by screenreaders

Parameters:
accessibilityDescription - description text
Returns:

setRowDescription

public void setRowDescription(String accessibilityDescription,
                              int row)
sets the sematical description for the component in it's applicationcontext used by screenreaders

Parameters:
accessibilityDescription - description text
Returns:

getRowDescription

public String getRowDescription(int row)
sets the sematical description for the component in it's applicationcontext used by screenreaders

Returns:


Copyright 2006 SAP AG Complete Copyright Notice