borland Packages  Class Hierarchy  dx.dataset Package 

PickListDescriptor class

java.lang.Object
   +----com.borland.dx.dataset.PickListDescriptor

About the PickListDescriptor class

Constructors  Properties  Methods  

Implements Serializable

The PickListDescriptor describes a pick list relationship between a Column of one DataSet (the target DataSet), and a second DataSet (the source DataSet) that provides values from which you can choose. The following properties are stored in the PickListDescriptor:

There are three basic ways to configure the pickList property, the first two are the more common uses:

  1. A simple "fill in". For visual controls, the pick list provides a selection of values from a pickListDataSet. The selected values are filled into the specified columns.

    For this configuration, set the pickListDataSet, destinationColumns (columns to copy to), pickListColumns (columns to copy from the pickListDataSet), and pickListDisplayColumns (columns values to display from the pickListDataSet when the pickList column is being edited).

  2. "Fill in" and "lookup" display. Provides the same functionality as above, except you can specify a lookupDisplayColumn from the pickListDataSet. This allows you to store a "code number" code in the column, but display a "code description".

    The values from the lookupDisplayColumn in the pickListDataSet are displayed instead of the values stored in the pickListColumns. A value to display is chosen by using the current values in destinationColumns to locate the row in the pickListDataSet that has the same values for its pickListColumns.

    If a match is found, the lookupDisplayColumn value for that row in the pickListDataSet is displayed. Note that the DataSet.setValue() and getValue() methods retrieve and set the "real" value stored. To retrieve the display value for such a column, use the DataSet.getDisplayVariant() method.

  3. Dynamically created read-only "lookup". This configuration is a little more work to setup, but allows an application to show both the code and code description values dynamically. You can achieve a similar effect with the first configuration above, however, this configuration displays the code description from the pickListDataSet. So if the code description is changed in your pickListDataSet, that change will be reflected in your DataSet since this display value is always "looked up". In the first configuration described above, if the code description changes in the pickListDataSet, your DataSet will still show the old "fill in" values.

    The lookup column is a special calculated column that retrieves its display values from the pickListDataSet. Although the pickList editor is activated when edits are attempted on this column, no value can be set on this column. It always retrieves its values by looking them up in the pickListDataSet. The lookup operation uses the same mechanism and properties described in the second configuration above. To create a lookup Column, you must add a Column to your DataSet and set its calcType property to CalcType.LOOKUP. Then set the pickList property much like configuration #2. The only difference is that the lookup column cannot be one of the columns listed in the destinationColumns property.


PickListDescriptor constructors

PickListDescriptor properties

*Read-only properties **Write-only properties

Properties implemented in this class

Properties implemented in java.lang.Object

PickListDescriptor methods

Methods implemented in java.lang.Object


PickListDescriptor constructors

PickListDescriptor(com.borland.dx.dataset.DataSet, java.lang.String[], java.lang.String[], java.lang.String[], boolean)

  public PickListDescriptor(DataSet pickListDataSet, String[]pickListColumns, String[]pickListDisplayColumns, String[]destinationColumns, boolean enforceIntegrity)
Constructs a PickListDescriptor object with the properties stated in its parameters.

Parameters:

pickListDataSet
The DataSet object that contains the data for display in the pick list.
pickListColumns
The columns of the pickListDataSet from which values in the selected row are copied to the destinationColumns.
pickListDisplayColumns
The Column components of the DataSet to display in the pick list. This property is expressed as an array of String column names. If your pick list contains multiple columns, you must also set the itemEditor property of the Column to an instance of the PopupPickListItemEditor. The default pick list item editor is the PickListItemEditor, which can only display a picklist with a single column.
destinationColumns
The Column components that are populated with the values associated with the selected pick list choice. This property is expressed as an array of String column names.
enforceIntegrity
Whether to enforce data integrity rules (data constraints) on the data added to the destinationColumns.

PickListDescriptor(com.borland.dx.dataset.DataSet, java.lang.String[], java.lang.String[], java.lang.String[], java.lang.String, boolean)

  public PickListDescriptor(DataSet pickListDataSet, String[]pickListColumns, String[]pickListDisplayColumns, String[]destinationColumns, String lookupDisplayColumn, boolean enforceIntegrity)
Constructs a PickListDescriptor object with the properties stated in its parameters.

Parameters:

pickListDataSet
The DataSet object that contains the data for display in the pick list.
pickListColumns
The columns of the pickListDataSet from which values in the selected row are copied to the destinationColumns.
pickListDisplayColumns
The Column components of the DataSet to display in the pick list. This property is expressed as an array of String names.
destinationColumns
The Column components that are populated with the values associated with the selected pick list choice. This property is expressed as an array of String column names.
lookupDisplayColumn
The name of the Column in the picklistDataSet to display the column whose pickList property is being set.
enforceIntegrity
Whether to enforce data integrity rules (data constraints) on the data added to the destinationColumns.

PickListDescriptor properties

destinationColumns

 public final String[]getDestinationColumns()
Read-only property that returns the String names of the Column components that are filled in when an entry in the pick list is selected. Set this property using the PickListDescriptor constructor. This property is also used for the display of lookup values and if not set, your application may generate a java.lang.NullPointerException error.

enforceIntegrity

 public boolean isEnforceIntegrity()
Read-only property that returns whether to enforce data integrity rules (data constraints) on the data added to the destinationColumns. Set this property using the PickListDescriptor constructor. This property is not currently used.

lookupDisplayColumn

 public final String getLookupDisplayColumn()
Read-only property that returns the name of the Column in the picklistDataSet to display for this (the column whose pickList is being defined) column in data-aware controls.

pickListColumns

 public final String[]getPickListColumns()
Read-only property that returns the Column components to read from when filling in data from the pickListDataSet into the columns specified in the destinationColumns property. Set this property using the PickListDescriptor constructor.

If your pick list contains multiple columns, you must also set the itemEditor property of the Column to an instance of the PopupPickListItemEditor. The default pick list item editor is the PickListItemEditor, which can only display picklist with a single column.

pickListDataSet

 public final DataSet getPickListDataSet()
Read-only property that returns the pickListDataSet used to choose values from. Set this property using the PickListDescriptor constructor.

pickListDisplayColumns

 public final String[]getPickListDisplayColumns()
Read-only property that returns a String array of the Column names to display from the pickListDataSet. Set this property using the PickListDescriptor constructor.