7.1 Adding the Component Reference Part
Now you are ready to add a Component
Reference part to the Customer Inquiry window.
Follow these steps:
- Open the GUI Designer for the
Customer Inquiry project and open the Customer Inquiry window CUSTINQ.
- Locate the Component
Reference part and add it to the Customer Inquiry window
- Double-click on the Component
Reference part on the Customer Inquiry window and make the following changes:
- Under the General
tab for the attribute Part name type the value MONCHG.
Deselect the Visible checkbox. If this checkbox is selected the Component
Reference part will show on the Customer Inquiry window when you run the
application.
- Under the Reference
tab for the attribute Component name type the value COMPLIST.
- For the attribute Window
name type the value CUSTLIST.
- For the attribute Part
name type the value EF2.
- For the attribute Part
attribute name type the value TEXT.
- Under the Notify
tab for the attribute Window name type the value CUSTLIST.
- For the attribute Part
name type the value EF2.
- For the attribute Event
name type the value CHANGE.
- Click on the OK
push button to save and close the notebook.
Next you write an action
subroutine which will be invoked when the Component Reference part MONCHG
gets notified by a CHANGE Event from the Entry field EF2. When the Entry field change
event occurs, the Component Reference part will signal a Notify Event.
Follow these steps:
- Write an action subroutine for the
MONCHG Notify event that retrieves the ATTRVALUE from
the MONCHG part and puts it into the variable CUSTNO.
*...1....+....2....+....3....+....4....+....5....+....6....+....7....+.
CSRN01Factor1+++++++Opcode(E)+Factor2+++++++Result++++++++Len++D+HiLoEq
C 'MONCHG' Getatr 'AttrValue' CustNo
- Copy this value to the CUSTNO
field in the Customer Inquiry window with the SETATR statement:
CSRN01Factor1+++++++Opcode(E)+Factor2+++++++Result++++++++Len++D+HiLoEq
C 'CustNo' Setatr CustNo 'Text'
Remember to save your source in
the Editor.
Click on
to indicate that you've done all the steps.