Consultor Eletrônico



Kbase 17376: ACTIVEX - How to Link the CSSpin Control to a DB Field
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   29/05/2003
Status: Unverified

GOAL:

How to Link the CSSpin Control to a DB Field

GOAL:

How to associate the CSSpin activex control to a database field and use the
control to change the data in the underlying field.

FIX:

1) Create a SmartViewer and drop database fields onto the
SmartViewer and include Customer.discount.

2) Disable Customer.discount from the field's property sheet
and check inclusion into {&ADM-ASSIGN-FIELDS} from the
advanced properties of the field.

3) Choose the Spin Button from the UIB palette and place it on
the SmartViewer next to the customer discount field.

4) Write a trigger for OCX.ChangeSpin event and add the following
code:

DO WITH FRAME {&FRAME-NAME}:
sports.Customer.Discount:SCREEN-VALUE =
STRING(chCtrlFrame:CSSpin:VALUE).
END.

5) Create an adm local-display-fields and add the following code
after standard behavior:

DO WITH FRAME {&FRAME-NAME}:
IF AVAILABLE Customer THEN
ASSIGN chCtrlFrame:CSSpin:VALUE = sports.Customer.Discount.
END.