Defining the tab order in a DataWindow object

When PowerBuilder generates the basic DataWindow object, it assigns columns a default tab order, the default sequence in which focus moves from column to column when a user presses the Tab key at runtime. PowerBuilder assigns tab values in increments of 10 in left-to-right and top-to-bottom order.

NoteTab order is not used in the Design view Tab order is used when a DataWindow object runs, but it is not used in the DataWindow painter Design view. In the Design view, the Tab key moves to the controls in the DataWindow object in the order in which the controls were placed in the Design view.

If the DataWindow object contains columns from more than one table

If you are defining a DataWindow object with more than one table, PowerBuilder assigns each column a tab value of 0, meaning the user cannot tab to the column. This is because, by default, multitable DataWindow objects are not updatable—users cannot modify data in them. You can change the tab values to nonzero values to allow tabbing in these DataWindow objects.

For more about controlling updates in a DataWindow object, see Chapter 21, “Controlling Updates in DataWindow objects.”

NoteTab order changes have no effect in grid DataWindow objects In a grid DataWindow object, the tab sequence is always left to right (except on right-to-left operating systems). Changing the tab value to any number other than 0 has no effect.

StepsTo change the tab order:

  1. Select Format>Tab Order from the menu bar or click the Tab Order button on PainterBar2.

    The current tab order displays.

  2. Use the mouse or the Tab key to move the pointer to the tab value you want to change.

  3. Enter a new tab value in the range 0 to 9999.

    0 removes the column from the tab order (the user cannot tab to the column). It does not matter exactly what value you use (other than 0); all that matters is relative value. For example, if you want the user to tab to column B after column A but before column C, set the tab value for column B so it is between the value for column A and the value for column C.

  4. Repeat the procedure until you have the tab order you want.

  5. Select Format>Tab Order from the menu bar or click the Tab Order button again.

    PowerBuilder saves the tab order.

Each time you select Tab Order, PowerBuilder reassigns tab values to include any columns that have been added to the DataWindow object and to allow space to insert new columns in the tab order.

NoteChanging tab order at runtime To change tab order programmatically at runtime, use the SetTabOrder method.