Websydian v6.1 online documentationOnline documentation - Websydian v6.5

Parent and Child Page Generator Parts


HtmlParentPageGenerator

If a Page Generator inherits from the HtmlParentPageGenerator pattern, a Page Replacement Marker will be inserted into the Document Template for each Child Page Generator being the target of a FNC includes FNC or a FNC comprises FNC triple from the Page Generator.

When a Page Generator meets such a Page Replacement Marker during its processing of the Document Template, it will automatically call the corresponding Child Page Generator.  The Child Page Generator will then generate its piece of the document and when completed, control will be returned to the Parent Page Generator.

The HtmlParentPageGenerator function itself is based on the ParentPageGenerator pattern.

ParentPageGenerator

The ParentPageGenerator pattern is a low-level pattern used by the HtmlParentPageGenerator pattern.  The ParentPageGenerator function defines the functionality to call a Child Page Generator whenever a Page Replacement Marker is met during the processing of the Document Template.

The Child Page Generator must be the target of a FNC includes FNC or a FNC comprises FNC triple from the Parent Page Generator, and the FNC includes FNC 

If the Page Replacement Marker is found during processing of the Details region, the WsyDetails variable will be used for mapping when calling the Child Page Generator.  If the Page Marker is met during processing of the Grid region, the WsyGrid variable will be used for mapping when calling the Child Page Generator.

The type of a Child Page Generator function is specified by the GridChild name option (default set to No).

ChildPageGenerator

A Parent Page Generator call other Child Page Generators in order to produce more complex documents.  In such cases, the Page Generators to be called must inherit from the ChildPageGenerator pattern.  By doing so, the Parent Page Generator will call the Child Page Generators automatically when it recognizes a Page Replacement Marker corresponding to a Child Generator.

The ChildPageGenerator pattern omits the generation of Content Type information as part of the generated document.  The Content Type generation can also be omitted by setting the Generate start and end option to No (may be necessary if the option has been changed by inheritance from other patterns).

HtmlDropDownGenerator

The HtmlDropdownGenerator is a specialization of the ChildPageGenerator pattern.  The HtmlDropdownGenerator pattern is used together with the HtmlParentPageGenerator pattern to implement the loading of a HTML drop-down box from table data.

See the Other Uses page for a full example of how to use the HtmlDropDownGenerator pattern to implement a dynamic drop-down in an Update page.

The HtmlDropDownGenerator function receives the key field(s) as input in the Input variable.  The values passed in this variable will be used to initialize the drop-down control.  If a blank input is passed, none of the values will be selected.  In this way, the drop-down control can be implemented in Update pages (predefined value selected) as well as in Create pages (no value selected).

The Document Template Generator scoped under the HtmlDropdownGenerator function will omit the HTML header and body definitions from the Document Template generation:

ChildDocumentTemplate.gif (13876 bytes)

Only the HTML code specifying the drop-down control part is included in the Document Template generated from a Page Generator based on the HtmlDropDownGenerator pattern.

If the listed entity contains more than one key field and/or more than one non-key field, it may be necessary to modify the generated Template Document.

The HtmlDropDownGenerator function also receives the key field(s) as input in the Position variable.  These fields are blanked by the function, but by defining part of the key in the Restrict variable these fields will be loaded back into the Position variable where they can then be used to position and/or restrict the database read.

This means that if you have fields in the restrict variable of your blockfetch function, the same fields must be present in the restrict variable of your HtmlDropDownPageGenerator function.

HtmlDropDownGenerator will load all records as specified by the used view and the Position and Restrict input fields in the BlockFetch function. The BlockFetch function will be called repeatedly until no more records are returned.

To override this behavior set the value of the field WsyGrid<GridCount> to the max number of records to fetch in the post point 0 Before loop in grid.