Kbase P98051: How to associate an EDITOR widget with a database table field?
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  11/24/2004 |
|
Status: Unverified
GOAL:
How to associate an EDITOR widget with a database table field?
FIX:
The following solution illustrates how to associate the EDITOR widget with a database field, and how to use the EDITOR widget to display change the data in an underlying field.
1. Start the AppBuilder and connect to to the Sports2000 database:
2. Create a new window in the AppBuilder.
3. Doubly click over the Editor widget to access its Property Sheet dialog.
4. ChooseClick on the Database Field Button to access the Field Selector dialog.
5. Select Customer from the Tables Column and Comments from the Fields Column and click OK.
6. Click OK on the Data Field Defaults dialog.
7. Click OK on the Property Sheet dialog.
8. Drop an Editor widget, a FILL-IN Widget and a two BUTTON Widgets on the window.
9. Use the BUTTONs Property Sheet dialog to assign object names DisplayButton and AssignButton.
10. Use the BUTTONs Property Sheet dialog to assign object labels Display Button and Assign Button.
11. Use the Section Editor to create the following CHOOSE event Trigger for the DisplayButton Widget:
DO:
FIND customer WHERE Custnum = INTEGER(FILL-IN-1:SCREEN-VALUE) NO-LOCK.
DISPLAY Comments WITH FRAME {&FRAME-NAME}.
END.
12. Use the Section Editor to create the following CHOOSE event Trigger for the AssignButton Widget:
DO:
FIND Customer WHERE Custnum = INTEGER(FILL-IN-1:SCREEN-VALUE).
ASSIGN Comments.
END.
13. Save and run the window.
14. Enter a customer number and CHOOSE the DisplayButton to see the comments field data displayed in the Editor widget.
15. Enter a customer numberand Type some new data and CHOOSE the AssignButton to change the value of that field.