Show TOC

Table ViewLocate this document in the navigation structure

Definition

Arrangement of data - text, images, links, other tables etc. - into rows and columns. TableView rows may be grouped into a head, foot and body section. The tableView supplies also navigation buttons which allow browsing thru the table.

  • cellDisabled

    Enables or disables a control in the specified cell. Currently the inputField control is the only control that can be disabled/enabled.

  • cellHAlignment

    Sets the horizontal alignment of the specified cell. Possible values are:

    • LEFT

      Left justifies the content of the cell.

    • RIGHT

      Right justifies the content of the cell.

    • CENTER

      Centers the content of the cell.

    • CHAR

      Aligns text around a specific character. Not supported by all web clients.

    • JUSTIFY

      Sets text in the cell left and right aligned. Not supported by all web clients.

  • cellHeaderVisible

    A boolean value that controls the visibility of the header of the columns. If the value is set to "FALSE" the header of the columns is not rendered.

  • cellInvalid

    This attribute can set the display of a control in the specified cell as "invalid" - to indicate the user that the data in this field is not correct. Currently the inputField control is the only control that can be "invalid".

  • cellRenderer

    Sets a cell renderer for the tableView control.

  • cellType

    Sets the display type for the specified cell. The cell type can be following controls:

    • BUTTON

    • IMAGE

    • IMAGELINK

    • INPUT

    • LINK

    • TEXT

    • USER

    • User defined cell type.

  • cellVAlignment

    Sets the vertical alignment of the specified cell. Possible values are:

    • BASELINE

      The content of the cell is aligned on the baseline line of the cell (or bottom when no baseline exits).

    • BOTTOM

      The content of the cell is aligned to the bottom line of the cell.

    • MIDDLE

      The content of the cell is aligned to the middle of the cell height.

    • TOP

      The content of the cell is aligned to the top line of the cell.

  • colspanForCell

    Sets the column span (width) of the specified cell.

  • columnAt

    Sets a TableColumn for the specified column.

  • columnCount

    Defines the amount of columns for the tableView.

  • columnHAlignment

    Sets the horizontal alignment of the specified column.

  • columnInvisible

    Sets a column with the specified key invisible.

  • columnName

    Sets the title of the specified column.

  • columnType

    Sets the display type for the specified column. The column type can be following controls:

    • BUTTON

    • IMAGE

    • IMAGELINK

    • INPUT

    • LINK

    • TEXT

    • USER

    • User defined column type.

  • columnVAlignment

    Sets the vertical alignment of the specified column.

  • design

    Defines the look of the table

    • ALTERNATING

      The rows of the table entries are colored alternating.

    • STANDARD

      The background of tableView is uniformly colored.

    • TRANSPARENT

      The tableView has no background.

  • emptyTableText

    Sets the text when the table model contains no data - is empty.

  • fillUpEmptyRows

    A boolean value. If set to "TRUE" the tableView has always the height set by the 'visibleRowCount' attribute, regardless of the available table entries. The not available table entries will be filled up with empty lines and according the 'design' attribute.

    If set to "FALSE" the tableView height is adjusted to the available table entries.

  • footerRenderer

    Sets a renderer for the table footer.

  • footerVisible

    A boolean value that controls the footer row. If set to "FALSE" the footer row including the navigation buttons is invisible.

  • headerCellRenderer

    Sets a renderer for the table header. The 'headerCellRenderer' renders the header column by column, so you have access to every column header.

  • headerRenderer

    Sets a renderer for the table header.

  • headerText

    Defines the headline of the tableView.

  • headerVisible

    A boolean value that controls the visibility of the header line. If the value is set to "FALSE" the header is not rendered and the table view starts with the cell header row. If the cell header row is invisible also, the table view starts with the data rows.

  • id

    Identification name of the tableView.

  • keyColumn

    Sets the specified column as key column.

  • linkColumnKey

    Sets the specified column as link

  • model

    Defines the model which provides the tableView with data. How to setup a TableViewModel .

  • navigationMode

    Controls the navigation buttons in the footer row.

    • BYPAGE

      Four navigation buttons are displayed that allow browsing page up, page down, first and last table entry

    • BYLINE

      Two additional buttons are displayed allowing single row up and down.

  • onCellClick

    Defines the event handling method that will be processed when the user clicks on one cell of the tableView. The 'onCellClick' event is set for an entire column. You can specify the column by column index or column key. For details see how to setup and work with the onCellClick event.

  • onClientCellClick

    Defines a Javascript fragment that is executed when the user clicks on one cell of the tableView. The 'onClientCellClick' event is set for an entire column. You can specify the column by column index or column key.

  • onClientRowSelection

    Defines a Javascript fragment that is executed when the user clicks on the radiobutton button in the first column.

  • onHeaderClick

    Defines the event handling method that will be processed when the user clicks on the header of the table. For details see how to setup and work with the onHeaderClick event.

  • onNavigate

    Defines the event handling method that will be processed when the user clicks on the navigation buttons. For details see how to setup and work with the onNavigate event.

  • onRowSelection

    Defines the event handling method that will be processed when the user clicks on the radiobutton button in the first column. The radiobutton is visible when the 'selectionMode' is set to "SINGLESELECT". The method com.sap.htmlb.event.TableSelectionEvent.getRowIndex() can be used to retrieve the index of the row that initiated the event. For details see how to setup and work with the onRowSelection event.

  • rowCount

    Defines the maximum record that is displayed together with the actual position (for example, 3/16 - meaning: actual position 3, maximum records 16) on the right side of the footer. If 'rowCount' is not specified the number of records in the model define the value.

  • rowRenderer

    Sets a row renderer.

  • rowSelectable

    Defines if the checkbox or radiobutton (dependend on the 'selectionMode') of the specified row, can be selected.

  • rowspanForCell

    Sets the row span for the specified cell.

  • rowVAlignment

    Sets the vertical alignment for a row.

  • selectionMode

    Defines how the table entries can be selected

    • MULTISELECT

      A checkbox is displayed on every row at the first column of the table. According to the nature of the checkbox multiple columns can be selected at a time.

    • NONE

      No selection possible (no checkbox and no radiobutton).

    • SINGLESELECT

      A radiobutton is displayed on every row at the first column of the table. According to the nature of the radiobutton one column can be selected at a time. Together with this attribute 'onRowSelection' attribute can be set so that an event is fired, when the user clicks on the radiobutton.

  • styleForCell

    Sets the style for the specified cell. Style can be BADVALUE, GOODVALUE, CRITICALVALUE to name a few.

  • summary

    Sets the summary.

  • tableHAlignment

    Sets the horizontal alignment for the entire tableView control.

  • userTypeCellRenderer

    Set a user defined cell renderer.

  • visibleFirstRow

    Defines the number of the table entry that is displayed in the first row of the tableView. All subsequent entries are displayed accordingly.

  • visibleRowCount

    Defines the visible rows of the tableView. If 'fillUpEmptyRows' is set to "TRUE", all rows specified with 'visibleRowCount' are displayed. The default for 'visibleRowCount' is the number of table entries supplied by the model.

  • width

    Defines the width of tableView.

Attributes

M

Values

Usage

cellDisabled

FALSE (d)

TRUE

Taglib

No tag available

Classlib

setCellDisabled(int rowIndex, int colIndex, boolean state)

cellHAlignment

CENTER

CHAR

JUSTIFY

LEFT

RIGHT

Taglib

No tag available

Classlib

setCellHAlignment(int rowIndex, int colIndex, CellHAlign.RIGHT)

cellHeaderVisible

FALSE

TRUE (d)

Taglib

No tag available

Classlib

setCellHeaderVisible(true)

cellInvalid

FALSE (d)

TRUE

Taglib

No tag available

Classlib

setCellInvalid(int rowIndex, int colIndex, Boolean state)

cellRenderer

Component

Taglib

No tag available

Classlib

setCellRenderer (ICellRenderer cr)

cellType

BUTTON

IMAGE

IMAGELINK

INPUT

LINK

TEXT (d)

USER

Taglib

No tag available

Classlib

setCellType(int rowIndex, int colIndex, TableColumnType.LINK)

cellVAlignment

BASELINE

BOTTOM

MIDDLE (d)

TOP

Taglib

No tag available

Classlib

setCellVAlignment(int rowIndex, int colIndex, CellVAlign.TOP)

colspanForCell

Numeric (1)

Taglib

No tag available

Classlib

setColspanForCell(int rowIndex, int colIndex, int colspan)

columnAt

Numeric

Taglib

No tag available

Classlib

setColumnAt(TableColumn col, int colIndex)

columnCount

Numeric (1)

Taglib

No tag available

Classlib

setColumnCount(10)

columnHAlignment

CENTER

CHAR

JUSTIFY

LEFT

RIGHT

Taglib

No tag available

Classlib

setColumnHAlignment (int colIndex, CellHAlign.RIGHT)

columnInvisible

String (cs)

Taglib

No tag available

Classlib

setColumnInvisible("columnName")

columnName

String (cs)

Taglib

No tag available

Classlib

setColumnName("columnName", 2)

columnType

BUTTON

IMAGE

IMAGELINK

INPUT

LINK

TEXT (d)

USER

Taglib

No tag available

Classlib

setColumnType (TableColumnType.LINK, int colIndex)

columnVAlignment

BASELINE

BOTTOM

MIDDLE (d)

TOP

Taglib

No tag available

Classlib

setColumnVlignment(int colIndex, CellVAlign.TOP)

design

STANDARD (d)

ALTERNATING

TRANSPARENT

Taglib

design="STANDARD"

Classlib

setDesign (TableViewDesign.STANDARD)

emptyTableText

String

Taglib

No tag available

Classlib

setEmptyTableText("No data")

fillUpEmptyRows

FALSE

TRUE (d)

Taglib

fillUpEmptyRows="FALSE"

Classlib

setFillUpEmptyRows(false)

footerRenderer

Component

Taglib

No tag available

Classlib

setFooterRenderer (IFooterRenderer fr)

footerVisible

FALSE

TRUE (d)

Taglib

footerVisible="FALSE"

Classlib

setFooterVisible(false)

headerCellRenderer

Component

Taglib

No tag available

Classlib

setFooterRenderer (IFooterRenderer r)

headerRenderer

Component

Taglib

No tag available

Classlib

setHeaderRenderer (IHeaderRenderer r)

headerText

String

Taglib

headerText="SAP training"

Classlib

setHeaderText("SAP training")

headerVisible

FALSE

TRUE (d)

Taglib

headerVisible="FALSE"

Classlib

setHeaderVisible(false)

id

*

String (cs)

Taglib

id="tCenter"

Classlib

setId("tCenter")

keyColumn

Numeric

(defined by model)

Taglib

No tag available

Classlib

setKeyColumn(3)

linkColumnKey

Taglib

No tag available

Classlib

setLinkColumnKey("linkRef", 3)

model

Component

Taglib

model=" myBean.model "

Classlib

setModel(( TableViewModel ) model)

navigationMode

BYPAGE (d)

BYLINE

Taglib

navigationMode="BYLINE"

Classlib

setNavigationMode (TableNavigationMode.BYLINE)

rowCount

Numeric

(defined by model)

Taglib

rowCount="5"

Classlib

setRowCount(5)

rowRenderer

Component

Taglib

No tag available

Classlib

setRowRenderer(IRowRenderer r)

rowSelectable

FALSE

TRUE (d)

Taglib

No tag available

Classlib

setRowSelectable(3, false)

rowspanForCell

Numeric

Taglib

No tag available

Classlib

setRowSpanForCell(int rowIndex, int colIndex, int rSpan)

rowVAlignment

BASELINE

BOTTOM

MIDDLE (d) TOP

Taglib

No tag available

Classlib

setRowVAlignment (3,CellVAlign.TOP)

selectionMode

MULTISELECT (d)

NONE

SINGLESELECT

Taglib

selectionMode="NONE"

Classlib

setSelectionMode (TableSelectionMode.NONE)

styleForCell

BADVALUE_DARK

BADVALUE_ LIGHT

BADVALUE_ MEDIUM

CRITICALVALUE_DARK

CRITICALVALUE_LIGHT

CRITICALVALUE_MEDIUM

GOODVALUE_DARK

GOODVALUE_LIGHT

GOODVALUE_MEDIUM

GROUP_HIGHLIGHTED

GROUP_HIGHLIGHTED_LIGHT

GROUP_LEVEL1

GROUP_LEVEL2

GROUP_LEVEL3

KEY_MEDIUM

MARKED

NEGATIVE

POSITIVE

STANDARD (d)

SUBTOTAL

SUBTOTAL_LIGHT

TOTAL

Taglib

No tag available

Classlib

setStyleForCell (int rowIndex, int colIndex, TableCellStyle.NEGATIVE)

summary

String

Taglib

No tag available

Classlib

setSummary("Total")

tableHAlignment

CENTER

CHAR

JUSTIFY

LEFT (d)

RIGHT

Taglib

No tag available

Classlib

setTableHAlignment (CellHAlign.CENTER)

userTypeCellRenderer

Component

Taglib

No tag available

Classlib

setUserTypeCellRenderer (ICellRenderer r)

visibleFirstRow

Numeric (1)

Taglib

visibleFirstRow="5"

Classlib

setVisibleFirstRow(5)

visibleRowCount

Numeric

(defined by model)

Taglib

visibleRowCount="20"

Classlib

setVisibleRowCount(20)

width

Unit

Taglib

width="500"

Classlib

setWidth("500")

Events

M

Values

Usage

onCellClick

String (cs)

Taglib

No tag available

Classlib

setOnCellClick(int colIndex, "Pr_Cell") setOnCellClick("colkKey", "Pr_Cell")

onClientCellClick

String (cs)

Taglib

No tag available

Classlib

setClientCellClick("alert('Click')")

onClientRowSelection

String (cs)

Taglib

No tag available

Classlib

setClientRowSelection("alert('Click')")

onHeaderClick

String (cs)

Taglib

No tag available

Classlib

setOnHeaderClick("onHeaderClickMethod")

onNavigate

String (cs)

Taglib

onNavigate("onNavigateMethod")

Classlib

setOnNavigate("onNavigateMethod")

onRowSelection

String (cs)

Taglib

No tag available

Classlib

setOnRowSelection("onRowSelMethod")

Example

using the taglib

  <hbj:tableView 
    id="myTableView1" 
    model="myTableViewBean.model" 
    design="ALTERNATING" 
    headerVisible="true" 
    footerVisible="true" 
    fillUpEmptyRows="true" 
    navigationMode="BYLINE" 
    selectionMode="MULTISELECT" 
    headerText="TableView example 1" 
    onNavigate="myOnNavigate" 
    visibleFirstRow="1" 
    visibleRowCount="5" 
    rowCount="16" 
    width="500 px" 
    />

         

using the classlib (For information about setting up the bean, see DefaultTableViewModel )

    Form form = (Form) this.getForm();
    TableView tv = new TableView("myTableView1");
    MyTableViewBean myBean = new MyTableViewBean();
    tv.setModel(myBean.getModel());
    tv.setDesign(TableViewDesign.ALTERNATING);
    tv.setHeaderVisible(true);
    tv.setFooterVisible(true);
    tv.setFillUpEmptyRows(true);
    tv.setNavigationMode(TableNavigationMode.BYLINE);
    tv.setSelectionMode(TableSelectionMode.MULTISELECT);
    tv.setHeaderText("TableView example 1");
    tv.setOnNavigate("myOnNavigate");
    tv.setVisibleFirstRow(1);
    tv.setVisibleRowCount(5);
    tv.setRowCount(16);
    tv.setWidth("500 px");
    form.addComponent(tv);

         

Result