JavaScript > JavaScript for Acrobat API Reference > JavaScript API > Doc > Doc properties > xfa

xfa
 
The property is defined only if the document is an XML form, that is, if the document was created in LiveCycle Designer. When defined, xfa is a static XFAObject, which is the root node of the underlying xfa model, and gives access to the xfa scripting object model (SOM).
Refer to the document Adobe XML Form Object Model Reference for details on the xfa SOM. The document Converting Acrobat JavaScript for Use in LiveCycle Designer Forms has a comparison between the Acrobat and LiveCycle Designer scripting object models.
Note: When executing this property from a folder level script, pass the Doc object from the document so that xfa will be executed in the proper context. See Example 2.
Type
XFAObject
Access
R
Example 1
Suppose this document is an XML form, and that there is a text field named EmployeeName. This example uses the xfa object to access and change the value of this field.
	var eN = this.xfa.form.form1.EmployeeName;
	console.println("\nEmployeeName: " + eN.rawValue);
The output to the console is
EmployeeName: A. C. Robat
Now change the value of the EmployeeName.
	eN.rawValue = "Robat, A. C."
	console.println("\nEmployeeName: " + eN.rawValue);
The output to the console is
EmployeeName: Robat, A. C.
The value of the field is changed.
Example 2
Call a function, defined in a folder level script file, that uses the xfa property, by passing the Doc object.
	function isXFA(doc) {
		var wasWasNot = (typeof doc.xfa == "undefined") ? "not" : "";
		console.println("This document was "+wasWasNot+"created by Designer.");
	}
From within the document, or from the console, the function is called is by isXFA(this).

 

Send me an e-mail when comments are added to this page | Comment Report

Current page: http://livedocs.adobe.com/acrobat_sdk/9/Acrobat9_HTMLHelp/JS_API_AcroJS.88.429.html