Progress
ADM 2 Guide
SmartDataField Usage Notes
This section discusses special programming considerations for using SmartDataFields.
Creating SmartDataFields
Because SmartDataFields do not have a Wizard, you must create them yourself. Here are the general steps for creating a SmartDataField, which you perform in the AppBuilder:
- Define the visualization of the SmartDataField; for example, by dropping an ActiveX Control onto it.
- Write code to set the DataModified property; for example, when the field’s value is changed in an AfterUpdate ActiveX event trigger.
- Implement the setDataValue and getDataValue functions (the template includes stubs for these functions):
- The setDataValue function, which is run from displayFields in the SmartDataViewer, sets the value of the field’s visualization by passing in the SmartDataObject field value to be assigned to the visualization.
- The getDataValue function returns the current value of the field’s visualization to the caller (typically collectChanges in the SmartDataViewer).
- Implement the disableField and enableField procedures to enable and disable the visualization (the template includes stubs for these procedures). There are also DisplayField and EnableField properties:
- The displayField property specifies whether the data value for the field is assigned to the SmartDataField automatically.
- The enableField property specifies whether the SmartDataField is updateable.
By default, these properties are set based on the corresponding properties for the original SmartDataObject field, but they can be set in the instance property dialog box.
- Modify the use list for the SmartDataField icon in the
smart.cst
file to include your special SmartDataField. This enables you to reuse your SmartObject by selecting it from the AppBuilder palette.For instructions on using the AppBuilder, see the Progress AppBuilder Developer’s Guide .
Adding SmartDataFields to SmartDataViewers
You add SmartDataFields to a SmartDataViewer after you pick all of the fields that will appear in the viewer (using the Wizard). To add a SmartDataField, select it from the AppBuilder palette and drop it onto the SmartDataObject field that it is to replace. As when you add SmartObjects to other SmartContainers, the AppBuilder then generates an adm–create–objects procedure to start the SmartDataField, including a FieldName property whose value is the name of the original SmartDataObject field.
Copyright © 2004 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |