GenerateXHTML method (DataWindows)
Description
Generates the
inline content of the Web DataWindow in XHTML.
Controls
DataWindow type |
Method applies to |
---|---|
Web |
Server component |
Syntax
[Web DataWindow server component]
1 |
string <span>dwcontrol</span>.<span>GenerateXHTML</span> ({<span>page</span>[ ] variables}) |
Argument |
Description |
---|---|
dwcontrol |
The name of the server-side DataWindow |
page |
An array for passing page variables. |
Return Values
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
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:
1 |
String resourceBase = request.getScheme() + "://" +<br>   request.getServerName() + ":" +<br>   request.getServerPort() + request.getContextPath();<br> <br>String publishPath = application.getRealPath("/");<br> <br>dwGen.Modify("DataWindow.CSSGen.ResourceBase = '" +<br>   resourceBase + "/css'");<br> <br>dwGen.Modify("DataWindow.CSSGen.PublishPath = '" +<br>   publishPath + "css'");dwGen.Modify("DataWindow.JSGen.ResourceBase = '" +<br>   resourceBase + "/js'");<br> <br>dwGen.Modify("DataWindow.JSGen.PublishPath = '" +<br>   publishPath + "js'");<br> <br>String dwXHTML = dwGen.<span>GenerateXHTML</span>();<br>out.print (dwXHTML); |