HTML for inserting the controls on a Web page
You include the controls on a Web page with an Object element
and associated Param elements. Then you write scripts that direct
the control to make database connections, retrieve and update data,
and respond to user actions.
The way the Object and Param elements look in a Web page are
described next. When you insert the controls and set their properties
using Web Target development in PowerBuilder, these elements are
coded for you.
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:88881503-<br /> 8888-1000-8000-080009AC61A9" width=343> |
1 |
</OBJECT> |
In a Web target, when you insert the Web ActiveX control by
dragging from the System Tree or by using the Insert>Component
menu item, the Object tag is written for you.
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 |
<i>url</i>#<i>version</i> |
A typical value for CODEBASE uses a relative URL:
1 |
CODEBASE="cabs/psdwc80.cab#8,0,1,200" |
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
or DataWindow Builder.
To find out the 4-part version number in Windows:
-
Select the PowerBuilder executable, DataWindow
Builder 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 8.0.1.6012.
Example
The Object element with a CODEBASE attribute looks like this:
1 |
<OBJECT codeBase=<br /> "http://www.domain.com/psdwc80.cab#Version=8,0,1,6012" |
1 |
id=PSDWC1 height=357 classid="CLSID:88881503-8888- |
1 |
1000-8000-080009AC61A9" width=343> |
1 |
</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”.
Properties and Param elements
How they work
The Web ActiveX and the Transaction Object control have several
properties that specify connection information. The Web ActiveX
also has properties that specify a DataWindow object or a PSR. You
provide values for the properties with Param elements, which are
enclosed in the Object element.
When you insert the controls in a Web target, Param elements
are automatically added to the Web page. You can provide values
for the Param elements using the control property sheets. You can
also write scripts that set or change property values.
The inserted Param elements are grouped in an order that corresponds
to pages in the control property sheets. The first group of Param
elements contains standard ActiveX properties.
The Web ActiveX also inserts Param elements for custom properties
that you set on the General, Scrolling, Transaction, and Trans User
pages of the Sybase DataWindow Web Control Properties dialog box.
The Transaction Object control has only two property pages: Transaction
and Trans User.
Standard ActiveX properties
1 |
<PARAM VALUE=65536 NAME="_Version"></PARAM> |
1 |
<PARAM VALUE=9280 NAME="_ExtentX"></PARAM> |
1 |
<PARAM VALUE=5155 NAME="_ExtentY"></PARAM> |
1 |
<PARAM VALUE=2 NAME="_StockProps"></PARAM> |
1 |
<PARAM VALUE="" NAME=Caption></PARAM> |
Properties on General page
1 |
<PARAM VALUE="javadwtest80.pbl" NAME=SourceFileName> </PARAM> |
1 |
<PARAM VALUE="d_emp" NAME=DataWindowObject></PARAM> |
1 |
<PARAM VALUE=0 NAME=SuppressEvents></PARAM> |
Properties on Scrolling page
1 |
<PARAM VALUE=0 NAME=VScrollBar></PARAM> |
1 |
<PARAM VALUE=0 NAME=HScrollBar></PARAM> |
1 |
<PARAM VALUE=0 NAME=HSplitScroll></PARAM> |
1 |
<PARAM VALUE=0 NAME=LiveScroll></PARAM> |
Properties on Transaction page
1 |
<PARAM VALUE="Driver='com.sybase.jdbc.SybDriver', URL='jdbc:sybase:Tds:localhost:7373'" NAME=dbParm> </PARAM> |
Properties on Trans User page
1 |
<PARAM VALUE=dba NAME=LogId></PARAM> |
1 |
<PARAM VALUE=sql NAME=LogPass></PARAM> |