Copying a DataWindow object into a library

The next DataWindow object you create will include the State column in the Customer table. This column uses a pre-defined DropDownDataWindow edit style called StateCode. A DropDownDataWindow edit style allows you to use another DataWindow object as the data source for a column. In this case, the DataWindow object has a list of states and their two-letter postal codes.

StateCode is an extended attribute associated with the State column in the EAS Demo database. Extended attributes are stored in system tables in the database and supply information about display formats, validation rules, edit styles, and fonts.

For more information about edit styles and extended attributes, see the DataWindow Designer User’s Guide.

You can see the definition of StateCode in the Database painter.

StepsTo view an edit style in the Database painter:

  1. Click the Database icon in the PowerBar to open the Database painter.

  2. In the Objects view, expand ODB ODBC>EAS Demo DB V105 DWD> Tables>customer>Columns, right-click the state column, and select Properties from the pop-up menu.

  3. Select the Edit Style tab in the Column Properties view and note that the Style Name is StateCode.

  4. In the Extended Attributes view, scroll down to StateCode and select Properties from its pop-up menu.

    The DataWindow option in the Edit Style dialog box shows that this edit style uses a DataWindow object called d_dddw_states.

    The image shows the Objects, Edit Styles, and Properties views in the database painter with the Edit Style dialog box for the drop down datawindow.
  5. Close the dialog box and the Database painter.

The d_dddw_states DataWindow object is available in the sample library installed with DataWindow Designer. To use it in your application, you need to copy it into your application’s library.

StepsTo copy a DataWindow object from one library to another:

  1. Click the Library icon in the PowerBar to open the Library painter.

  2. In the Tree view, navigate to the Sybase\DataWindow Designer 2.0\Code Examples directory and expand dwdexample.pbl.

  3. Right-click d_dddw_states and select Copy from its pop-up menu.

  4. In the Select Library dialog box, navigate to the start.pbl you created for this tutorial and click Open.

    The d_dddw_states DataWindow object displays in your library in the System Tree.