Working with a Host Application

A host application is the application in which a form exists at any given time.

For example, if you are using Forms to render a form in HTML format, then during the pre-rendering process the host application is Forms.

Once you render a form and view it in a client application such as Acrobat, Adobe Reader, or an HTML browser, then the client application becomes the host application.

Designer includes a scripting model that provides scripting properties and methods for directly interfacing with a hosting application. For example, you can use the properties and methods in the host scripting model to provide PDF page navigation actions in Acrobat or Adobe Reader, or you can use the importData method to load data into your form.

You can reference the host script model syntax on any valid scripting event for form design objects using the following syntax for both FormCalc and JavaScript:

    xfa.host.property_or_method

Host scripting model properties and methods

Using the host scripting model properties and methods, you can retrieve information and execute actions that are not otherwise accessible through calculations and scripts. For example, you can retrieve the name of the host application (such as Acrobat), or advance the current page on an interactive form. The following table lists the properties and methods that are available for the host scripting model.

For more information about the host scripting model properties and methods, see the LiveCycle Developer Center.

Comparing the host scripting model functionality

This table lists the Designer host scripting model properties and methods, and compares them to the equivalent expressions in the JavaScript Object Model in Acrobat.

For more information about the host scripting model properties and methods, see Designer Help , or see the Scripting Reference.

Host scripting model properties and methods

JavaScript Object Model from Acrobat equivalent

xfa.host.appType

app.viewerType

xfa.host.beep( [ INTEGER param ] )

app.beep([ nType ])

xfa.host.currentPage

doc.pageNum

xfa.host.exportData([ STRING param1 [, BOOLEAN param2 ] ])

doc.exportXFAData(cPath [, bXDP ])

xfa.host.gotoURL( STRING param1 )

doc.getURL(cURL, [ bAppend ])

or

app.launchURL(URL);

xfa.host.importData( [ STRING param ] )

doc.importXFAData(cPath)

xfa.host.language

app.language

xfa.host.messageBox(STRING param1 [, STRING param2 [, INTEGER param3 [, INTEGER param4 ] ] ])

app.alert(cMsg [, nIcon [, nType [, cTitle ] ] ])

xfa.host.name

none

xfa.host.numPages

doc.numPages

xfa.host.pageDown()

doc.pageNum++

xfa.host.pageUp()

doc.pageNum--

xfa.host.platform

app.platform

xfa.host.print(BOOLEAN param1, INTEGER param2, INTEGER param3, BOOLEAN param4, BOOLEAN param5, BOOLEAN param6, BOOLEAN param7, BOOLEAN param8)

doc.print([ bUI [, nStart [, nEnd [, bSilent [, bShrinkToFit [, bPrintAsImage [, bReverse [, bAnnotations ] ] ] ] ] ] ] ])

xfa.host.resetData( [ STRING param ] )

doc.resetForm([ aFields ])

xfa.host.response( STRING param1 [, STRING param2 [, STRING param3 [, BOOLEAN param4] ] ])

app.response(cQuestion [, cTitle [, cDefault [, bPassword ] ] ])

xfa.host.setFocus( STRING param )

field.setFocus()

(Deprecated)

xfa.host.title

doc.title

xfa.host.variation

app.viewerVariation

xfa.host.version

app.viewerVersion

// Ethnio survey code removed