Working with edit styles

You work with edit styles in the Database painter and DataWindow painter.

What you do in the Database painter

In the Database painter, you can:

  • Create, modify, and delete named edit styles

    The edit styles are stored in the extended attribute system tables. Once you define an edit style, it can be used by any column of the appropriate datatype in the database.

  • Assign edit styles to columns

    These styles are used by default when you place the column in a DataWindow object in the DataWindow painter.

What you do in the DataWindow painter

In the DataWindow painter, you can:

  • Accept the default edit style assigned to a column in the Database painter

  • Override the default edit style with another named style stored in the extended attribute system tables

  • Create an ad hoc, unnamed edit style to use with one specific column

Edit styles and the extended attribute system tables

When you have placed a column in a DataWindow object and have given it an edit style (either the default style from the assignment made in the Database painter for the column or a style assigned in the DataWindow painter), PowerBuilder records the name and definition of the edit style in the DataWindow object.

However, if the definition of the edit style later changes in the extended attribute system tables, the edit style for the column in a DataWindow object will not change automatically. You can update the column by reassigning the edit style to it in the DataWindow object.

Working with edit styles in the Database painter

Typically, you define edit styles in the Database painter, because edit styles are properties of the data itself. Once defined in the Database painter, the styles are used by default each time the column is placed in a DataWindow object.

To create a new edit style

  1. In the Database painter, select Object>Insert>Edit Style from the menu bar.

  2. In the Object Details view, select the edit style type from the Style drop-down list.

  3. Specify the properties of the edit style.

    For information, see Defining edit styles.

    You can use the new edit style with any column of the appropriate datatype in the database.

To modify an existing edit style

  1. In the Database painter, open the Extended Attributes view.

  2. In the Extended Attributes view, open the list of edit styles.

  3. Position the pointer on the Edit style you want to modify, display the pop-up menu, then select Properties.

  4. In the Object Details view, modify the edit style as desired and click OK.

    For information, see Defining edit styles.

    You can use the modified edit style with any column of the appropriate datatype in the database.

To associate an edit style with a column in the Database painter

  1. In the Database painter (Objects view), position the pointer on the column, select Properties from the pop-up menu, then select the Edit Style tab in the Properties view.

  2. Select a style for the appropriate datatype from the list in the Style Name box.

    PowerBuilder associates the selected edit style with the column in the extended attribute system tables.

To remove an edit style from a column in the Database painter

  1. In the Database painter (Objects view), position the pointer on the column, select Properties from the pop-up menu, then select the Edit Style tab in the Properties view.

  2. Select (None) from the list in the Style Name box.

    The edit style is no longer associated with the column.

Working with edit styles in the DataWindow painter

An edit style you assign to a column in the Database painter is used by default when you place the column in a DataWindow object. You can override the edit style in the DataWindow painter by choosing another edit style from the extended attribute system tables or defining an ad hoc style for one specific column.

To specify an edit style for a column

  1. In the DataWindow painter, move the pointer to the column, select Properties from the column's pop-up menu, and then select the Edit tab.

  2. Select the type of edit style you want from the Style Type drop-down list.

    The information in the Edit page changes to be appropriate to the type of edit style you selected.

  3. Do one of the following:

    • Select an edit style from the Style Name list.

    • Create an ad hoc edit style for the column, as described in Defining edit styles.