Consultor Eletrônico



Kbase 21879: How To Get and Use the SCREEN-VALUE of a SmartSelect
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   3/8/2002
SUMMARY:

Depending on your coding goals at the time, it might be necessary to obtain and use the SCREEN-VALUE of a SmartSelect. However, since the SmartSelect is a SmartObject, only the handle to the SmartSelect is available. The process outlined here shows you how to get the SCREEN-VALUE of the SmartSelect.

EXPLANATION:

The SmartSelect SmartObject is a dynamic tool for allowing users to select information based on the currently available records in an SDO.
By using the "Event on change" feature, you can publish the new value to the parent procedure for the SmartSelect.

SOLUTION:

This example assumes that you have a SmartViewer with a SmartSelect on a character field already created and opened. You can build upon this basic example to accomplish your own particular coding requirements.

1) Right click on the handle of the SmartSelect and choose Instance
Properties.

2) In the "Event on change" fill-in, enter a name for this process.
(In this example "valuepasser" is used.)

3) Click OK and close the Property Sheet.

4) Now open the Section Editor for the SmartViewer.

5) Select Procedures and click on New.

6) Now name this procedure "valuepasser" just as it was named in the
Event on change.

7) After the first commented line add this code;

Define input parameter thevalue as character.
Message thevalue view-as alert-box.

8) Now save the SmartViewer.

9) Now, when you run the main application that has the SmartViewer,
when the value changes in the SmartSelect, the value will be
messaged in the alert-box.