Release 10.1A: OpenEdge Development:
Progress Dynamics Web Development Guide

> ## Adding your own functions

> Progress Dynamics includes a JavaScript API, which contains a variety of client-side actions that are useful for creating your own functions.

> For example, the following code fragment is a function that uses the JavaScript API to refresh data from the DynSports customer table:

>     // Sample Javascript include for Client-side Custom logic
>     // refresh customer data every 10 seconds
>     window.setInterval('customerfullo_refresh()',10000);
>     function customerfullo_refresh(){
>       if(window.main.app==window &&
>     apph.action('customerfullo.handle').updatemode=='view'){
>       	 // Only run if currently in display and in view mode
>         apph.actions(['server.customerfullo.refresh','wbo.submit']);
>       }
>     }

> See Appendix A, "JavaScript API Reference," for descriptions of individual actions, syntax information, and examples.

> | To implement your JavaScript functions:

> 1. Save your JavaScript code to a file in the install_dir`\tty\dynamics\ry\dhtml\` directory or to a directory that your Progress Dynamics Broker can find.

> 2. Add your filename to the `JavaScriptFile` attribute in the Dynamic Properties dialog box on the class, master, or instance level of your object. (Normally, you would avoid overrides on the base or class level since all objects in the class would inherit your changes.)

> The following window shows that the values for the `JavaScriptFile` attribute is a comma-separated list of filenames:

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