GenerateXHTML

Description

Generates the inline content of the Web DataWindow in XHTML.

Applies to

DataWindow type

Method applies to

Web

Server component

Syntax

Web DataWindow server component

string dwcontrol.GenerateXHTML ({page[ ] variables})

Argument

Description

dwcontrol

The name of the server-side DataWindow control you want to generate in XHTML.

page

An array for passing page variables. The page variables must be defined as String datatypes.

Returns

Integer. 1 indicates success, and –1 indicates failure.

Usage

At runtime, GenerateXHTML performs the tasks required to generate the dynamic XHTML, including retrieving the action context and generating the XHTML inline. Connection errors, including database error messages, are also generated inline.

For information about the advantages and limitations of each rendering format, see the DataWindow Programmers Guide.

The GenerateXHTML method delivers the DataWindow in XHTML to the client browser and it generates a CSS style sheet and JS files that are cached on the client side and referenced in the XHTML source.

Examples

Example 1

The following JSP example specifies subdirectories of the current application directory to publish the CSS and JS components of the Web DataWindow and generates the DataWindow in XHTML:

String resourceBase = request.getScheme() + "://" +
   request.getServerName() + ":" +
   request.getServerPort() + request.getContextPath();

String publishPath = application.getRealPath("/");

dwGen.Modify("DataWindow.CSSGen.ResourceBase = '" +
   resourceBase + "/css'");

dwGen.Modify("DataWindow.CSSGen.PublishPath = '" +
   publishPath + "css'");dwGen.Modify("DataWindow.JSGen.ResourceBase = '" +
   resourceBase + "/js'");

dwGen.Modify("DataWindow.JSGen.PublishPath = '" +
   publishPath + "js'");

String dwXHTML = dwGen.GenerateXHTML();
out.print (dwXHTML);

See also