The ListManager bean associates a database file to a JComponent that holds multiple rows of data, so that you can manipulate a set of records from the JComponent. JComponents that have multiple data elements include JList, JComboBox, JTable, JFormattedComboBox, and JFormattedTable.
ListManager makes use of RecordIOManager for record level access and manipulation. The record format of a database file is defined in the property recordIOManager. For further information about the RecordIOManager bean, see the related reference below.
Before a ListManager can associate a JComponent to a field, you must do the following:
If the JComponent that has a field association is a JFormattedComponent, and its data attributes do not match the data type, data length, or decimal places of the database field, the ListManager bean automatically changes those attributes if the autoChangeDataAttributes property is set to true. The following table outlines the attributes that can be changed for the different field types:
Field type | Data type | Length | Decimal Places |
---|---|---|---|
binary (B) | DATATYPE_ NUMERIC | no change | 0 |
character (A) | DATATYPE_ CHARACTER | field length | 0 |
DBCS Either (E) | DATATYPE_ CHARACTER | field length | 0 |
DBCS Graphic (G) | DATATYPE_ CHARACTER | field length | 0 |
DBCS Only (J) | DATATYPE_ CHARACTER | field length | 0 |
DBCS Open (O) | DATATYPE_ CHARACTER | field length | 0 |
date (L) | DATATYPE_ CHARACTER | field length | 0 |
float (F) | DATATYPE_ NUMERIC | If the data length of the JFormattedComponent is less than the number of field decimal places, then the length equals the number of decimal places plus 10. | field decimal places |
float(F) | DATATYPE_ CHARACTER | 20 | 0 |
hexadecimal (H) | DATATYPE_ CHARACTER | 2 times field length FormManager displays the hexadecimal representation of the field. |
0 |
packed decimal (P) | DATATYPE_ NUMERIC | field length | field decimal places |
time (T) | DATATYPE_ CHARACTER | field length (8 bytes) | 0 |
timestamp (Z) | DATATYPE_ CHARACTER | field length (26 bytes) | 0 |
zoned decimal (S) | DATATYPE_ NUMERIC | field length | field decimal places |
If the JComponent is a javax.swing.JTable or com.ibm.etools.iseries.ui.JFormattedTable, and has no TableColumn defined, then the ListManager bean automatically creates table columns based on the selectedColumnNames defined in recordIOManager which, by default, contains all the field names of the record format.
If the JComponent is a javax.swing.JTable or com.ibm.etools.iseries.ui.JFormattedTable, and the openType of the database file is OPENTYPE_READ_WRITE, then whenever a different row is selected, and data in the previously selected row has been changed, the previously selected row is updated in the database file automatically. If you insert a new row before or after the current row, you can enter new values in the inserted row, and when the selected row of the table is changed, the new row is added to the database file automatically. If the openType of the database file is OPENTYPE_READ_ONLY, any changes made to the JTable or JFormattedTable are not updated in the database file.
(C) Copyright IBM Corporation 1992, 2006. All Rights Reserved.