Trees and Tables

This document provides brief descriptions of the table and tree components available for developing Nexawb Java Application UIs. This document also provides brief descriptions of the table and tree component specific attributes.

table

A collection of data arranged in columns and rows.

Nexaweb Studio makes this widget available in the Palette view from which you can drag and drop it onto a UI file in the Visual Editor.

Example XAL for using this widget in a freePane:

<table height="200px" width="300px" x="10px" y="50px">
  <column>
   <header text="Column #1"/>
  </column>
  <column>
   <header text="Column #2"/>
  </column>
  <row>
   <cell text="Row 1 Cell 1"/>
   <cell text="Row 1 Cell 2"/>
  </row>
  <row>
   <cell text="Row 2 Cell 1"/>
   <cell text="Row 2 Cell 2"/>
  </row>
  <row>
   <cell text="Row 3 Cell 1"/>
   <cell text="Row 3 Cell 2"/>
  </row>
</table>

tree

Displays data in a hierarchical format.

Nexaweb Studio makes this widget available in the Palette view from which you can drag and drop it onto a UI file in the Visual Editor.

Example XAL for using this widget in a freePane:

<tree height="100px" width="180px" x="10px" y="20px">
  <column/>
  <row>
   <cell text="Tree Item 1"/>
   <row>
    <cell text="Sub Tree Item 1"/>
   </row>
   <row>
    <cell text="Sub Tree Item 2"/>
   </row>
  </row>
  <row>
   <cell text="Tree Item 2"/>
  </row>
 </tree>

treeTable

 

Combines a tree and table to display hierarchical data in a tabular format.

Nexaweb Studio makes this widget available in the Palette view from which you can drag and drop it onto a UI file in the Visual Editor.

Example XAL for using this widget in a freePane:

 <treeTable height="120px" width="280px" x="10px" y="170px">
  <column>
   <header text="Column #1"/>
  </column>
  <column>
   <header text="Column #2"/>
  </column>
  <row>
   <cell text="Tree Item 1"/>
   <cell text="Tree Item 1"/>
   <row>
    <cell text="Sub Tree Item 1"/>
    <cell text="Sub Tree Item 1"/>
   </row>
   <row>
    <cell text="Sub Tree Item 2"/>
    <cell text="Sub Tree Item 2"/>
   </row>
  </row>
  <row>
   <cell text="Tree Item 2"/>
   <cell text="Tree Item 2"/>
  </row>
 </treeTable>

Table and Tree Attributes

The following table lists and provides brief descriptions of table and tree component specific attributes: 

AttributeDescription
altBackgroundColorBy default, the table component provides a different background color for alternating rows in the table. Use this attribute to specify the background color for alternating rows in the table.
altColorSpecifies the font color of text that appears in alternating rows in the table.
collapsedImageSpecifies an image to visually represent a collapsed row.
expandedImageSpecifies an image to visually represent an expanded row.
highlightBackgroundColorSpecifies the background color to appear when a row is selected.
highlightColorSpecifies the font color of text when a row is selected.
horizontalLineColorSpecifies the color of the horizontal border lines that separate rows. By default, the horizontal border lines are opaque.
keyMatchResetSpecifies the time in seconds after which a user stops typing that the pattern matching functionality resets.
leafImageSpecifies the icon to use for a row with no children.
quickEditUse in conjunction with:
The Table selectionMode attribute set to singleCell
The Column editable attribute set to true

Then, set this attribute to true and when a user clicks on an editable cell, the user can immediately begin editing that cell. In addition, when the user presses the up/down/left/right arrows, focus transfers to adjacent cells, which, if in columns with the editable attribute set to true, the user can also immediately begin editing. 

Pressing the enter key commits text and proceeds to the next cell in the column.

When a table with the quickEdit attribute set to true receives focus, the last edited cell will be placed in quick edit mode if possible.

To return a cell from quckEdit mode to editable mode, where a user edits using the arrow keys, click on the cell.  Right-click on the cell to again return to quick edit mode. Or use the F2 key to toggle between edit modes of the cell.

resizableColumnsSpecifies whether a user can resize columns by resizing the column headers.
True=yes; false=no. True by default.
rowHeightSpecifies the row height for all rows in the table.
rowImageVerticalAlignmentSpecifies the vertical alignment of images in a row as top or center. Center by default.
selectionModeSpecifies what can be selected in the table at a given time. For example, only a single row or a single cell, or multiple rows (using Shift or Ctrl keys). singleRow by default.
sortTypeSpecifies the column sorting method as stable or unstable
stable: Use for multi-column sorting; preserves the order of equal elements. Combine with the columns sortPriority attribute.
unstable: Does not make ties between columns; the sort action for each column sorts that entire column and does not provide any special handling for adjacent columns.
swappableColumnsSpecifies whether a user can rearrange the column order by dragging the column headers.
True=yes; False=no. True by default. 
treeLineColorSpecifies the color of the lines connecting nodes in tree rows.
verticalLineColorSpecifies the color of the vertical border lines that separate columns. By default, the vertical border lines are opaque.

Cell

A table cell is one cell in a table row. Cells are optimized for use in tables. Although rows can hold any type of component, using cells is more efficient.

The following table lists and provides brief descriptions of cell specific attributes: 

AttributeDescription
editableSpecifies whether a user can edit this cell. If specified, the value of this attribute overrides the value of the editable attribute set for the column in which the cell resides.
editingIndicates when a cell with the editable attribute set to true is being edited. Set this attribute to true to place an editable cell into edit mode. Only one cell can be in editing mode at any given time.
selectedUse in conjunction with the table\tree\treeTable selctionMode attribute set to singleCell or multiCell.  Then, this attribute specifies whether the cell is selected. True=yes; false=no.
sortValueSpecifies a value to use for sorting the cell rather than the text contained in the cell. Specify a sortValue that matches the type of data specified by the column dataType attribute, as the dataType attribute controls how the table sorts data.
textSpecifies the text content of the cell.
valueSpecifies a logical value for the cell/listItem rather than the displayed text. This value is sent back to the server when a selection is made in a listBox or treeTable that is the selection component of a comboBox that is part of a form. It is also reported as part of the event parameter string in the ClientEvent or server URL.

Column

Defines the properties of a single column in a table.

The following table lists and provides brief descriptions of column specific attributes: 

AttributeDescription
dataTypeSpecifies the dataType (number, string, bigDecimal, and so forth) for the cells in this column. The table uses different methods to sort different datatypes.
editableSpecifies whether a user can edit cells in this column. True=yes; false=no.
editorSpecifies a custom editor for the column. This should be a reference to a textField or comboBox that was declared in the defs section of the UI document. The default editor for an editable column is a simple textBox.
selectedSpecifies the status of the column as selected or unselected. True=selected; false=unselected.
sortSpecifies the order by which to sort the column: ascending or descending.
The value of this attribute in the DOM always reflects the current sort state of the column.
sortableSpecifies whether a column can be sorted by clicking on the column header. True=yes; false=no.
sortPrioritySpecifies the priority to give the column in table sorting. Priority should have a minimum of 1, which is the highest priority. When multiple columns in a table have priorities set, the table sorts such that the column with the highest priority (lowest number) is sorted, while the secondary column is sorted relative to the higher priority column. This means the values in the secondary column are not fully sorted, only sorted where elements in the first column are tied. Use this attribute in conjuction with the Table sortType attribute set to stable as unstable sorts do not preserve ties while reordering.
visualIndexThe visual index of the column, this will be updated as columns are repositioned by the user. The index is 0-based. This is similar to DisplayService.getVisualColumnIndex(). This attribute is intended to be read-only, setting it will have no effect on the UI.
widthSpecifies a fixed width for the column. By default, if you do not specify this attribute, Nexaweb autosizes column to fit the components in it.
The value of this attribute in the DOM always reflects the current width of the column.

 

Row

Defines a horizontal collection of cells and other components in a table

The following table lists and provides brief descriptions of row specific attributes: 

AttributeDescription
collapsedImageSpecifies an image to visually represent a collapsed row.
Setting this attribute overrides the Table collapsedImage attribute.
expandedSpecifies whether the row is expanded or contracted. True=expanded; false=contracted.
The value of this attribute in the DOM always reflects the current expansion state in the UI.
expandedImageSpecifies an image to visually represent an expanded row.
Setting this attribute overrides the Table expandedImage attribute.
heightSpecifies a fixed height for the row. By default, if you do not specify this attribute, Nexaweb autosizes the row to fit the components in it.
leafImageSpecifies the icon to use for a row with no children.
Setting this attribute overrides the Table leafImage attribute.
selectedSpecifies the status of the row as selected or unselected. True=selected; false=unselected.