PSDataWindowClass

Creates a new object for a Web DataWindow control. This object lets you add a Web DataWindow object (that you create in DataWindow Designer, PowerBuilder, or InfoMaker) to your page.

Adding a Sybase Web DataWindow DTC to an HTML page creates an object of type PSDataWindowClass. If the page is 4GL-enabled, an object of type PSWebDataWindowClass is created instead.

Syntax

ASP targets

PSDataWindowClass({objectName}, {ServerSideStateManagement}, {jaguarConnection}, {sourceLocation}, {dbConnection}, {lPageSize})

JSP targets

PSDataWindowClass(pageContext, request, objectName, ServerSideStateManagement, jaguarConnection, sourceLocation, dbConnection, {lPageSize})

NoteOptional arguments in constructor for ASP targets If you use a String value for any of the last three arguments in the constructor for ASP targets, the optional arguments that can precede the value you enter are no longer optional and must be included in the constructor.

Constructors

PSDataWindowClass constructor

Datatype

Description

pageContext

PageContext

Implicit object created by the JSP server to handle page requests.

request

HttpServletRequest

Object created by servlet container for HTTP requests.

objectName

String

The name of the client-side control. An entry for objectName is optional for ASP targets. If you do not specify a name, htmlDW is used as the default object.

ServerSideStateManagement

boolean

Specifies where the database state is managed. (An entry for ServerSideStateManagement is optional for ASP targets.):

  • true The server manages the database state. A reference to the server component is saved and retrieved from the session object (based on the name of the Web DataWindow object).

  • false (default) The client manages the database state.

jaguarConnection

String

The connection information needed to connect to EAServer. An entry for jaguarConnection is optional for ASP targets. If this property is null (default), the object uses an ActiveX server component.

sourceLocation

String

The location of the DataWindow object. An entry for sourceLocation is optional for ASP targets. If this property is null (default), the server component must encapsulate the identity of the source.

dbConnection

String

The database connection properties. An entry for dbConnection is optional for ASP targets. If this property is null (default), the server component must encapsulate the database connection properties.

lPageSize (Optional)

String

The size of the page:

  • 0 Indicates that all rows retrieved from the database will be generated.

  • -1 (default) Indicates that the size of the page is specified in the definition for the Web DataWindow control.

  • Any positive integer Specifies the number of rows that will be passed to, and therefore contained in, the Web DataWindow control.

Properties

PSDataWindowClass property

Datatype

Description

Component

Object

Represents a reference to a server component for a Web DataWindow control. A server component is either an ActiveX or EAServer component that interacts with a page server that supports ActiveX or Java. For information about the server component, see the DataWindows Programmer's Guide.

RetrievalArgs [ ]

String

An array of arguments used to retrieve data from the database. You can specify these retrieval arguments or use the FillRetrievalArgs method to do so.

Methods

PSDataWindowClass method

Description

FillRetrievalArgs

Fills in the array that stores the retrieval arguments.

Generate

Generates the DataWindow as HTML.

GenerateXHTML

Generates the DataWindow as XHTML.

GenerateXMLWeb

Generates the DataWindow as XML.

SetColumnLink

Establishes a link for a column that is passed to the Web DataWindow control.

SetWeight

Identifies the type of functionality included on your HTML page. (As you include more functionality on your page, the size of the control increases.)

Examples

Example 1

The following example shows how to define a new Web DataWindow object named htmlDwObj for an ASP target. The Web DataWindow object uses a client-side control named htmlDw1, and a previously defined EAServer connection object named jagParm:

Var htmlDwObj = new PSDataWindowClass(htmlDw1, false,
		jagParm)

Example 2

For JSP targets, you must assign a variable as an object of the PSDataWindowClass type before you can instantiate it, and you must use semicolons to terminate each line of code:

PSJaguarConnection jagConn = new PSJaguarConnection("my-desktop:9000", "jagadmin", "", "DataWindow/HTMLGenerator90", false);

PSDataWindowSourceClass dwSource = new PSDataWindowSourceClass("d:\\test\\appl.pbl", "dw_dept");	

PSConnectionParmsClass  dbConn = new PSConnectionParmsClass("ConnectString='DSN=EAS Demo DB V4;UID=dba;PWD=sql',ConnectOption='SQL_DRIVER_CONNECT,SQL_DRIVER_NOPROMPT'" );

PSDataWindowClass webDW = new PSDataWindowClass (pageContext, request, "webDW", false, jagConn, dwSource, dbConn, 10);