Online documentation - Websydian v6.0

Users Guide | Patterns Reference | WebsydianExpress | Search

 

The Document Template Generator Main Function

The Document Template Generator function generates a first-cut version of the HTML Document Template used by a Page Generator function.

In Websydian, Document Templates are used by the Page Generator functions to determine the contents and layout of the HTML pages sent to web users.  The Document Templates are themselves represented in valid HTML format.

Page Generators work by producing HTML pages based on a Document Template.  The contents of the Document Template is copied as-is to the produced HTML page, except when a replacement marker is met in the template.  Then, the replacement marker is substituted with the corresponding field in the WsyDetails or WsyGrid region of the Page Generator function.

Each Page Generator function in a Websydian application will have a Document Template Generator function scoped under it.  This Document Template Generator is generated and built at development-time and when the function is run, it will produce a first-cut Document Template that can be used by the Page Generator function.  The contents of the generated Document Template is determined by the definitions in the scoping Page Generator function and the associated Event Handler functions.

For each Event Handler function associated to the Page Generator function, an HTML form is generated on the Document Template.  The HTML forms will either be Details forms or Grid forms (one HTML form for each row in the grid).  See also the Background page for a detailed overview of the generated Document Templates.

More Information

See the introduction document Page Generators and Document Templates for an overview of the page generation process based on Document Templates.

The Document Template Generator function is provided by the _DocumentTemplateGenerator function pattern scoped under the ReplacementProcess pattern.  The PageGeneratorWithJavaScript function pattern enhances the Document Template generation with JavaScript code to handle the initialization list box, radio button and check box controls.