DhTable Class

DhTable Class

This Package | All Packages

DhElement
  |
  +--DhBaseContainer
    |
    +--DhTable
public class DhTable
extends DhBaseContainer

Creates a table element that can be populated with rows and columns.

Constructors
Name Description
DhTable() Creates a DhTable object.

Methods
Name Description
add(DhRow row, DhRow relativeTo, int insertFlag) Adds a row to this table either at the top or the bottom, or before or after another the row depending on the DhInsertEnum insertFlag parameter.
add(DhRow row, int insertFlag) Adds a row to this table either at the top or bottom depending on the DhInsertEnum insertFlag parameter.
add(DhRow row) Adds a row at the bottom of this table.
getBorder() Retrieves the default (non-CSS) border thickness of the table

Return Value:

Returns the thickness of the border.

getCell( int nRow, int nCol ) Retrieves the cell at the given location.
getFooterRow() Retrieves the footer row if there is one.
getHeaderRow( ) Retrieves the header row if there is one.
getPageSize() Retrieves the current data page size, in rows, to display in a data-bound operation.
getRepeaterClone() Retrieves data row cloning for databound tables.
getRow( int nRow ) Retrieves the specified row.
getRowCount() Retrieves the number of rows in the table, including header and footer rows.
getTagNameID() Topic under construction.
removeAll() Topic under construction.
removeBodyRows() Topic under construction.
setBorder( int width ) Sets the default (non-CSS) border width for this table.
setDataSource( DhDataSource ds )

Note This method is obsolete.

setDataSource( DhDataSource ds, DhRow repeaterRow ) Sets the data source and repeater row template for this table.
setDataSource( DhElement ds )

Note This method is obsolete.

setDataSource( DhElement ds, DhRow repeaterRow ) Sets the data source and repeater row template for this table.
setFooterRow( DhRow r ) Sets the footer row to the DhRow specified.
setHeaderRow( DhRow r ) Sets the header row to the DhRow specified.
setHTMLGenerator( DhHTMLGenerator htmlGen ) Topic under construction.
setPageSize( int nPageSize ) Sets the display page size for this table when bound to data.
setRepeaterClone( boolean value ) Sets data row cloning for data-bound tables.
showNextPage() Displays the next page of data in the table.
showPreviousPage() Displays the previous page of data in the table.

Constructors

DhTable.DhTable

Syntax
public DhTable();
Description

Creates a DhTable object. This default constructor creates an empty table element.

Methods

DhTable.add

Syntax 1
public void add( DhRow row, DhRow relativeTo, int insertFlag );
Parameters
row
The row to add to this table.
relativeTo
The row referred to when using the INSERT_BEFORE or INSERT_AFTER constants for the insertFlag parameter.
insertFlag
One of the valid and applicable insert constants. The valid values for insertFlag are:
  • INSERT_END inserts the row at the bottom of this table. The relativeTo parameter must be null.
  • INSERT_BEGINNING inserts the row at the top of this table. The relativeTo parameter must be null.
  • INSERT_BEFORE inserts the row before the row referred to by the relativeTo parameter. The relativeTo parameter must not be null.
  • INSERT_AFTER inserts the row after the row referred to by the relativeTo parameter. The relativeTo parameter must not be null.
Description

Adds a row to this table either at the top or the bottom, or before or after another the row depending on the DhInsertEnum insertFlag parameter.



Syntax 2
public void add( DhRow row, int insertFlag );
Parameters
row
The DhRow row to add to this table.
insertFlag
One of the valid and applicable insert constants. The valid values for insertFlag are:
  • INSERT_END inserts the row at the bottom of this table. The relativeTo parameter must be null.
  • INSERT_BEGINNING inserts the row at the top of this table. The relativeTo parameter must be null.
Description

Adds a row to this table either at the top or bottom depending on the DhInsertEnum insertFlag parameter.



Syntax 3
public void add( DhRow row );
Parameters
row
The DhRow row to add to this table.
Description

Adds a row at the bottom of this table.

DhTable.getBorder

Syntax
public int getBorder();
Return Value

Returns the thickness of the border.

Description

Retrieves the default (non-CSS) border thickness of the table

DhTable.getCell

Syntax
public DhCell getCell( int nRow, int nCol );
Parameters
nRow
The zero-based row number.
nCol
The zero-based column number.
Return Value

Returns the cell at the requested position.

Description

Retrieves the cell at the given location.

Exceptions

wfc.html.DhElementNotFoundException thrown if there is no cell at the specified location.

DhTable.getFooterRow

Syntax
public synchronized DhRow getFooterRow();
Return Value

Returns the footer DhRow, or returns null if no footer DhRow exists.

Description

Retrieves the footer row if there is one.

DhTable.getHeaderRow

Syntax
public synchronized DhRow getHeaderRow( );
Return Value

Returns the header DhRow, or returns null if no header DhRow exists.

Description

Retrieves the header row if there is one.

DhTable.getPageSize

Syntax
public int getPageSize();
Description

Retrieves the current data page size, in rows, to display in a data-bound operation.

DhTable.getRepeaterClone

Syntax
public boolean getRepeaterClone();
Return Value

Returns true if cloning is enabled; otherwise, false.

Description

Retrieves data row cloning for databound tables. If true, generated data rows will be converted into DhElement derived items that you can interact with. This process considerably slows down table generation, so activate it only if you need to interact with, or sink events from, the elements in a databound table.

See Also
setRepeaterClone

DhTable.getRow

Syntax
public synchronized DhRow getRow( int nRow );
Parameters
nRow
The row to retrieve.
Return Value

Returns the row at position nRow.

Description

Retrieves the specified row. If a header row exists, 0 is specified for the header row; otherwise, it specifies the first row in the table body.

Exceptions

wfc.html.DhElementNotFoundException thrown if the row is not in the table.

DhTable.getRowCount

Syntax
public synchronized int getRowCount();
Return Value

Returns the total number of rows.

Description

Retrieves the number of rows in the table, including header and footer rows.

DhTable.getTagNameID

Syntax
protected int getTagNameID();
Description

Topic under construction.

DhTable.removeAll

Syntax
public void removeAll();
Description

Topic under construction.

DhTable.removeBodyRows

Syntax
public void removeBodyRows();
Description

Topic under construction.

DhTable.setBorder

Syntax
public void setBorder( int width );
Parameters
width
The thickness of the border.
Description

Sets the default (non-CSS) border width for this table.

DhTable.setDataSource

Syntax 1
public synchronized void setDataSource( DhDataSource ds );
Description

Note This method is obsolete.



Syntax 2
public synchronized void setDataSource( DhDataSource ds, DhRow repeaterRow );
Parameters
ds
The data source.
repeaterRow
The row template to use.
Description

Sets the data source and repeater row template for this table. The row template contains cells with items that have data field attributes set on them. This row and all its styles are copied for each record in the database. To access the generated rows, call setRepeaterClone( true ). By default, this is set to false because cloning is time and processor intensive.



Syntax 3
public synchronized void setDataSource( DhElement ds );
Description

Note This method is obsolete.



Syntax 4
public synchronized void setDataSource( DhElement ds, DhRow repeaterRow );
Parameters
ds
The data source.
repeaterRow
The row template to use.
Description

Sets the data source and repeater row template for this table. The row template contains cells with items that have data field attributes set on them. This row and all its styles are copied for each record in the database. To access the generated rows, call setRepeaterClone( true ). By default, this is set to false because cloning is time and processor intensive.

DhTable.setFooterRow

Syntax
public synchronized void setFooterRow( DhRow r );
Parameters
r
The new footer row. Set to null to clear the existing footer row.
Description

Sets the footer row to the DhRow specified.

DhTable.setHeaderRow

Syntax
public synchronized void setHeaderRow( DhRow r );
Parameters
r
The new header row. Set to null to clear the existing header row.
Description

Sets the header row to the DhRow specified.

DhTable.setHTMLGenerator

Syntax
public synchronized void setHTMLGenerator( DhHTMLGenerator htmlGen );
Description

Topic under construction.

Overrides

setHTMLGenerator(DhHTMLGenerator) in DhBaseContainer.

DhTable.setPageSize

Syntax
public void setPageSize( int nPageSize );
Parameters
nPageSize
Number of rows to display per page.
Description

Sets the display page size for this table when bound to data.

DhTable.setRepeaterClone

Syntax
public void setRepeaterClone( boolean value );
Parameters
value
Set to true to enable cloning; otherwise, set to false.
Description

Sets data row cloning for data-bound tables. If true, generated data rows will be converted into DhElement-derived items that you can interact with. This process considerably slows down table generation, so activate it only if you need to interact with, or sink events from, the elements in a databound table.

See Also
getRepeaterClone

DhTable.showNextPage

Syntax
public void showNextPage();
Description

Displays the next page of data in the table.

See Also
setPageSize

DhTable.showPreviousPage

Syntax
public void showPreviousPage();
Description

Displays the previous page of data in the table.

See Also
setPageSize