Avatar

Level 1

I was looking into the Doc and app objects that you suggested. I can't seem to add my own object to Doc, but I can to app. The only thing with app is that it is persistent.

The app object would be a great place to create a namespace object for storing properties and methods that are common to all my forms.

I was thinking that the xfa object would be a better place to store properties and methods specific to a particular form. Garbage collection doesn't seem to be an issue, but I could be wrong.

Here is a simple example of what I am doing, and it seems to work:

- add a makeMandatory() method to app.OBJ that accepts an array of form controls (persistent method used by all forms)

- add an array of form controls to xfa.OBJ when the form is initialized (array can be dynamic)

- when a button is clicked, run the following script: app.OBJ.makeMandatory(xfa.OBJ.mandatoryFormControls);