The Web DataWindow server component and client control

The Web DataWindow has two main components: the server component and the client control.

Web DataWindow server component

The Web DataWindow server component retrieves data from a database and returns JavaScript and XSLT, XHTML, or HTML that represent the data and the DataWindow object definition to the page server. The server component is a PowerBuilder custom class user object that uses a DataStore to handle retrieval and updates and is deployed as an EAServer component. You can use the generic component provided with PowerBuilder or a custom component.

The generic EAServer component, HTMLGenerator125, is preinstalled in EAServer in a package named DataWindow.

NoteUsing an older version of the generic component Earlier versions of the generic HTMLGenerator component are also installed in the EAServer DataWindow package. Because EAServer supports multiple PowerBuilder VMs, you can continue to run older Web DataWindow applications that use this component.

The generic component has methods that you call in your Web page template to instantiate and configure the component. The generic component also provides most of the methods available on the PowerBuilder DataWindow control. You should probably use the generic component when you are getting started with the Web DataWindow. Later you might want to build and deploy a custom component that uses the methods of the generic EAServer component interface or that uses only the methods you design for the component. For information, see “Using a custom server component”.

Types of server components and platforms

The following table describes all the types of Web DataWindow server components and their supported platforms:

Table 6-1: Web DataWindow server components and platforms

Web DataWindow server component

Platform

(server component name)

Description

Generic

EAServer (DataWindow::HTMLGenerator125)

Prebuilt EAServer component. No generation or compiling of stubs required.

Container (can include multiple DataWindow definitions)

EAServer (PackageName::ComponentName using generic DataWindow::HTMLGenerator125 interface)

Deploy with Web DW Container project wizard. Increases performance by reducing calls to server. No generation or compiling of stubs required.

Custom (hybrid)

EAServer (PackageName::ComponentName using generic DataWindow::HTMLGenerator125 interface)

Use to increase flexibility of generic component. Can build and deploy with PB object or project wizard. Generic methods remain available.

Custom (user-designed)

EAServer (PackageName::ComponentName)

Potentially best for performance and scalability. Can use to avoid downloads of unneeded generic methods to client.

Web DataWindow client control

Embedding client-side scripts The Web DataWindow client control is the JavaScript plus XML, XSLT, and CSS; the JavaScript plus XHTML; or the JavaScript plus HTML that is generated by the server component and embedded in the page returned to the Web client. Client-side scripts that you add to your Web page template and wrap in SCRIPT tags are embedded as JavaScript in the client control.

JavaScript caching Some features available on the client control are optional: events, methods, data update and validation, and display formatting for newly entered data. The size of the generated JavaScript increases as you add more client-side functionality. You can cache client-side methods in JavaScript files on your Web server to reduce the size of the markup generated for Web DataWindow pages and, if the browser is configured to use cached files, improve the performance on the client machine.

For information about enabling JavaScript caching, see “Using JavaScript caching for Web DataWindow methods”. You can find additional information about client-side caching, HTMLGen properties, and other generation properties in the DataWindow Reference.

Using client-side events Events that are triggered on the client control and several of the client control methods do not require the server component to reload the page, so processing on the client is typically much faster than processing performed on the server.

For more information about enabling features on the client, see “Web DataWindow properties” and “Controlling what is generated”. For more about writing scripts, see “Writing client-side scripts”.

For complete documentation of the events and methods available on the server component and the client control, see the DataWindow Reference or the PowerBuilder online Help.