Object element
How it works
ActiveX controls use the Object element to specify the GUID
(a unique identifier) of the control as well as the space the control
takes on the page. The Object tag looks like this:
1 |
<OBJECT id=PSDWC1 height=357 classid="CLSID:CCCC1503-CCCC-1000-8000-080009AC61A9" width=343> |
1 |
</OBJECT> |
CODEBASE attribute
If your users need to download the controls, you can include
the CODEBASE attribute in the Object element to identify the file
to be downloaded. After the browser downloads the CAB file, it unpacks
it and registers the ActiveX controls in the user’s system
registry.
The value for CODEBASE has the format:
1 |
<span>url</span>#<span>version</span> |
A typical value for CODEBASE uses a relative URL:
1 |
CODEBASE="cabs/psdwc126.cab#12,6,0,1053" |
URL
The URL is the location of the DataWindow control’s
CAB file on your Web server. It can be an absolute or relative URL.
Version
The version is a set of four numbers, separated by commas.
The numbers must match the version of the CAB file. The version
number of the CAB file is the same as the version number for PowerBuilder.
To find out the 4-part version number in Windows:
-
Select the PowerBuilder executable or a
PowerBuilder DLL in Windows Explorer. -
Select File>Properties from the menu
bar. -
On the Version tab, look at File Version. A typical
number is 12.6.1.
Example
The Object element with a CODEBASE attribute looks like this:
1 |
<OBJECT codeBase=<br>"http://www.domain.com/psdwc126.cab#Version=12,6,0,<br>1053" id=PSDWC1 height=357 classid="CLSID:CCCC1503-CCCC-1000-8000-080009AC61A9" width=343><br></OBJECT> |
New versions
When you get new versions of the CAB file, you can change
the version numbers on the Web page and cause the browser to install
a new version of the control.
For more information about how to deploy new versions, see “Deploying the Web ActiveX”.
Putting the Object tag in a separate file
If the Cumulative Security Update for Internet Explorer (912812)
or a subsequent update is installed on the computer where the Web
ActiveX control is running, a browser refresh does not refresh the
control correctly. This update is described in Microsoft Security
Bulletin MS06-013, published in April 2006.
To work around this issue, put the <OBJECT> tag
in a separate JavaScript file instead of the main HTML file, as
shown in this example:
1 |
// HTML file<br><HTML><br><HEAD><br>   <TITLE>test</TITLE><br></HEAD><br><BODY bgColor="white" PSPARAMS=""><br><P>Put your data here </P><br><P>&nbsp;</P><br><P><br>   <div id="DivID"><br>      <script src="createElement.js"></script><br>   </div><br></BODY><br></HTML> |
The createElement.js JavaScript file
contains the Object tag:
1 |
// createElement.js file<br>var d = document.getElementById("DivID");<br>d.innerHTML = <br>'<OBJECT id="OBJECT1" style="WIDTH: 627px; HEIGHT: 320px" codeBase="psdwc126.cab" classid="CLSID:CCCC1503-CCCC-1000-8000-080009AC61A9">'<br>+'<PARAM NAME="_Version" VALUE="65536"></PARAM>'<br>+'<PARAM NAME="_ExtentX" VALUE="16589"></PARAM>'<br>+'<PARAM NAME="_ExtentY" VALUE="8467"></PARAM>'<br>+'<PARAM NAME="_StockProps" VALUE="2"></PARAM>'<br>+'<PARAM NAME="Caption" VALUE=""></PARAM>'<br>+'<PARAM NAME="SourceFileName" VALUE="test.psr"></PARAM>'<br>+'<PARAM NAME="DataWindowObject" VALUE="test.psr"></PARAM>'<br>+'<PARAM NAME="LogId" VALUE=""></PARAM>'<br>+'<PARAM NAME="LogPass" VALUE=""></PARAM>'<br>+'<PARAM NAME="dbParm" VALUE=""></PARAM>'<br>+'<PARAM NAME="SuppressEvents" VALUE="0"></PARAM>'<br>+'<PARAM NAME="VScrollBar" VALUE="0"></PARAM>'<br>+'<PARAM NAME="HScrollBar" VALUE="0"></PARAM>'<br>+'<PARAM NAME="HSplitScroll" VALUE="0"></PARAM>'<br>+'<PARAM NAME="LiveScroll" VALUE="0"></PARAM>'<br>+'</OBJECT>'; |