Customizer's Guide > Working with ActiveX Controls > Executing ActiveX Controls Using the .dcf File to Bind to an Element dDrectly > Configuring the .dcf File
  
Configuring the .dcf File
To associate an element with an ActiveX control, edit the attributes of the ActiveXControl element in your custom .dcf file for the document type containing the element.
The ActiveXControl element has the following attributes:
Attribute
Description
element
(Required) Name of the XML or SGML element to be associated with the ActiveX control.
controlName
(Required) User-defined name for the control. Provides the link to event binding and script associations
scriptFileName
(Required) The system file name for the script file containing the required functions for handling the control.
The current directory will be searched first for the script. The load path, containing the Arbortext-path\custom\scripts directory, will then be searched.
scriptName
(Optional) User-defined name for the script context. If not specified, a unique name for the script context is generated. By default, no two ActiveX controls created using the .dcf file will use the same script context.
programId
(Required) The name for the ActiveX control as registered in the Windows registry. It is the user-friendly form of the COM 128–bit Class ID (or GUID).
scriptLanguage
(Optional) Name by which users specify a scripting language which is not automatically recognized by file extension. VBScript and JScript are the only supported script languages.
condition
(Optional) An XPath expression. This attribute value allows the user to define more specific conditions for when an ActiveX control should be initiated for the given element.
For example, to launch a particular ActiveX control based on a particular attribute value on a graphic element, that condition can be defined as an XPath expression. If the expression, in the context specified by the element instance, is TRUE, ActiveX processing will continue. If the expression is FALSE, the element will not cause any ActiveX behavior.
inPlaceActivate
(Optional) If yes, embeds the XUI dialog box containing the control in the document displayed in Arbortext Editor. If no (the default), displays the control in a standalone dialog box.
eventName
(Optional) The DOM event name that runs the ActiveX control. If unspecified, the default is DOMActivate.
As an example, a .dcf file's ActiveXControl element could have the following attributes:
<ActiveXControl
element="date"
controlName="cal"
scriptFileName="date.js"
scriptName="date"
programId="MSCAL.Calendar"
eventName="DOMActivate"
inPlaceActivate="no">
</ActiveXControl>
This example specifies the following association:
Run the control when a DOMActivate event happens on a date element.
Create a new Microsoft ActiveX Calendar control with a Program ID of MSCAL.Calendar.
Name the control “cal” in the script engines list of named variables. (This provides the name used for script event binding and the methods which write to and from the XML data, described below.)
If the control attached to this DOM element is running, bring it to the desktop foreground. If the control attached to this DOM element has not been launched, then create and display it.
Run the Cal_OnInitialize(activenode) function. This function name is a combination of the control name “Cal”, an underscore character, and “OnInitialize”. activenode is the element causing the ActiveX control to be loaded.
Once the user selects a date and closes the control, the function Cal_OnClose(activenode) captures the current date from the Calendar and inserts the <date> element's PCDATA.
If the window is closed because the element is deleted, the control window is closed and the Cal_OnCancel(activenode) function (if one exists) runs.
Refer to the examples at the end of this section for other sample ActiveXControl attribute settings.