Progress
ADM 2 Guide


Localizing Standard SmartObject Behavior

Another advantage of using super procedures to implement classes of behavior is that you can localize each of the internal procedures and functions that compose a super procedure in any individual SmartObject by writing a procedure or function of the same name. You can do this either to replace the standard behavior or to augment the standard behavior as required by the SmartObject. The Section Editor supports this functionality by identifying the internal procedures and functions that you can override based on the type of object that you are creating.

For example, follow these steps in the AppBuilder to create a new displayFields procedure for a SmartDataViewer:

  1. In the Object Palette, right-click on the SmartDataViewer button.
  2. Choose New SmartDataViewer.
  3. Complete the steps in the SmartDataViewer Wizard.
  4. Choose the Edit code button on the AppBuilder toolbar.
  5. Change the Section to Procedures.
  6. Click on the New button. The New Procedure dialog box appears.
  7. Choose the Override Type radio button. The Name fill-in becomes a combo box:
  8. Choose the displayFields procedure and click on OK. The Section Editor generates a skeleton of the local procedure or function. This contains the necessary parameter definitions and, by default, invokes the standard behavior by executing the RUN SUPER or RUN SUPER ( ) statement:
  9. You can change this code as required for your application. For example, to change the color of the fields in the SmartDataViewer, change the code as shown:
  10. NOTE: This code augments the standard displayFields behavior and affects all instances created from this master.


Copyright © 2004 Progress Software Corporation
www.progress.com
Voice: (781) 280-4000
Fax: (781) 280-4095