Lesson 7: Creating an Employee List  Lesson 7: Creating an Employee List


Attach the DataWindow object to a DataWindow control

Note

Now you attach the DataWindow object to a DataWindow control in the w_emplist_tutorial_main window.

  1. Expand the emplist_tutorial.pkl branch in the System Tree.

    Shown is p b tutor dot pibble expanded in the System Tree. Of the objects that it includes, the window named w _ customers is highlighted.
  2. Right-click w_emplist_tutorial_main and select Edit from the pop-up menu

    or

    Double-click w_emplist_tutorial_main in the System Tree.

    The Window painter displays the w_emplist_tutorial_main window.

  3. Select Insert>Control>DataWindow from the menu bar.

    Click the main window in the Layout view.

    A DataWindow control displays.

    Shown is p b tutor dot pibble expanded in the System Tree. Of the objects that it includes, the window named w _ customers is highlighted.
  4. In the Properties view, select HScrollBar and VScrollBar to enable you to scroll through the list of employees when you run the application.

    Now you need to associate the d_sqlgr_employee DataWindow object with the DataWindow control in the window.

  5. In the Properties view, click the button next to the DataObject text box.

    Select the d_sqlgr_employee DataWindow.

    Shown is the General tab page of the Properties view. At  top is the Data Object box with the entry d _ cust list.
  6. Click OK.

    PocketBuilder associates the d_sqlgr_employee DataWindow object with the DataWindow control.

    The Layout view now shows the d_sqlgr_employee DataWindow headings inside the DataWindow control, but you do not see any data yet. The DataWindow does not execute its SELECT statement until you run the application.

  7. Select the DataWindow control and then and drag its borders so the control takes up most of the space in the main window.

    When you are done, the window should look something like this:

    Shown is the Design view. The horizontal Heading band at the top includes the headings Customer I D, First Name, Last Name, and Company Name. The Detail band below it displays the column names i d , f name, l name, and company _ name.




Copyright © 2004. Sybase Inc. All rights reserved. Lesson 7: Creating an Employee List

View this book as PDF