Events: Connection Point (IE-Specific)
Authentic Browser provides various connection point events (see also Events: Reference), for which you can provide event handlers in the SCRIPT blocks on your HTML page.
Note: | The description in this section applies to Internet Explorer only. |
The following samples show SCRIPT blocks for the ControlInitialized and SelectionChanged events:
ControlInitialized
This connection point event is triggered immediately after the control is created and initialized. Additional startup scripting for the control can be handled inside the ControlInitialized event handler.
<SCRIPT LANGUAGE=javascript FOR=objPlugIn EVENT=controlinitialized>
// add your code here
</SCRIPT>
SelectionChanged
The SelectionChanged event is triggered each time the current selection in the view changes. Use a SCRIPT block to execute your event-specific code.
<SCRIPT LANGUAGE=javascript FOR=objPlugIn EVENT=selectionchanged>
// add your code here
</SCRIPT>
Please note that the Authentic.event object is not populated when this event occurs. If event handlers are registered in your script, the Authentic.event object properties contain values from the last event to have occurred. The Authentic.CurrentSelection object now contains valid information.
Loading SPS, XSD, and XML files without user intervention
If you wish to load the .sps, .xsd and .xml files without user intervention when loading the HTML page, it is the preferred method to write an event handler that handles the ControlInitialized event. Alternatively a property bag can be used as in the second example:
Recommended:
<SCRIPT LANGUAGE="javascript" FOR=objPlugIn EVENT="ControlInitialized">
objPlugIn.SchemaLoadObject.URL = "http://yourserver/OrgChart.xsd"
objPlugIn.XMLDataLoadObject.URL = "http://yourserver/OrgChart.xml"
objPlugIn.DesignDataLoadObject.URL = "http://yourserver/OrgChart.sps"
objPlugIn.StartEditing()
</SCRIPT>
or
<OBJECT id=objPlugIn style="WIDTH:600px; HEIGHT:500px"
codeBase="http://yourserver/cabfiles/AuthenticBrowserEdition.CAB#Version=12,3,0,0"
classid=clsid:B4628728-E3F0-44a2-BEC8-F838555AE780>
<PARAM NAME="XMLDataURL" VALUE="http://yourserver/OrgChart.xml">
<PARAM NAME="SPSDataURL" VALUE="http://yourserver/OrgChart.sps">
<PARAM NAME="SchemaDataURL" VALUE="http://yourserver/OrgChart.xsd">
</OBJECT>
It is not recommended to load these files in an event handler that handles the "body" elements "onload" event as the Authentic Browser PlugIn control may be initialized after the "onload" event is fired. If this is the case the PlugIn's methods and properties will not be available, and the files will not load. Also see The OBJECT Element for details.
Not recommended:
<SCRIPT LANGUAGE="javascript">
function load () {
objPlugIn.SchemaLoadObject.URL = "http://yourserver/OrgChart.xsd"
objPlugIn.XMLDataLoadObject.URL = "http://yourserver/OrgChart.xml"
objPlugIn.DesignDataLoadObject.URL = "http://yourserver/OrgChart.sps"
objPlugIn.StartEditing()
}
</SCRIPT>
<body onload = "load files">