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

Parent and Child Page Generator Patterns

The Websydian Parent and Child Page Generators consist of the HtmlParentPageGenerator and HtmlDropDownGenerator patterns which in turn are based on the ParentPageGenerator and ChildPageGenerator low-level patterns.

These patterns are used to specify generation of more or less complex documents produced by having Page Generators calling other Page Generators.  Parent and Child Page Generator patterns also provide the basis for the implementation of the PageGeneratorWithErrorList and the XmlGenerator patterns.

See also the Other Uses page for examples on how to use the HtmlDropDownGenerator pattern to implement dynamic drop-down, i.e a drop-down list populated with table data.

Implementing Parent and Child Page Generators

It is easy to implement a call of a Child Page Generator from a Parent Page Generator.

Source Object Verb Target Object
MyParentPage is a FNC HtmlParentPageGenerator
comprises FNC MyChildPage
MyChildPage is a FNC PageGenerator
is a FNC ChildPageGenerator
impl name NME ChildP
file name NME ChildP

By applying the specifications above, a Page Replacement Marker will be inserted in the Document Template of the MyParentPage function.

When the Page Replacement Marker is met during the page generation process, the corresponding Child Page Generator will automatically be called to produce the HTML fragment to be inserted in the Parent document.

The Child Page can be inserted into the Details region or into the Grid region of the Parent document, which is determined by the GridChild option on the Child Page Generator (which by default is set to No).  The GridChild option also determines whether input parameters to the Child Page Generator are mapped from the WsyDetails region or from the WsyGrid region of the calling Parent Page Generator.

Source Object Verb Target Object
MyChildPage option NME
...value SYS
GridChild
Yes

Child Page Generators may themselves be Parent Page Generators calling other Children.

Position Page Replacement Marker in Document Templates

By default, Details Page Replacement Markers will be inserted into the top of the HTML Template while Grid Page Replacement Markers are inserted just below the Grid.  The Document Template should then be edited and the Page Markers can be moved to specific positions by the developer.