Create a Dynamic Child Page

Overview

A child page is included on a parent page using the FNC includes/comprises FNC triple on the parent PageGenerator function. This relation is specified at development, and thus requires a recompilation whenever you want to add the child page to another parent page.

To avoid this you can use the dynamic child page (function WSYAPI/Abstract.DynamicChildPageGenerator). As the child page the dynamic child page generator only generates part of a HTML page which then is included in the parent page.

Define dynamic child page function

You define the page and specify which functions you want to generate and build using the following triples.

Source Object Verb Target Object
MyDynamicChildPage is a FNC WSYAPI/Abstract.DynamicChildPageGenerator
implement SYS Yes
MyDynamicChildPage.
_DocumentTemplateGenerator
implement SYS Yes

Include the child page in the parent page

You include a dynamic child page on a parent page by inserting the following in the HTML template for the parent PageGenerator:

/(CHILDFNC-MyChild)

The string value after the dash is the implementation name of the dynamic child PageGenerator (in the above example the implementation name is MyChild).

Some things to note:

Transferring parameters from parent to child

It is possible to transfer parameters from the parent PageGenerator function to the child PageGenerator function. This is done using the following syntax:

/(CHILDFNC-MyChild?ProdCode)

The value for the field with implementation name ProdCode will be transferred from WsyDetails or WsyGrid in the parent PageGenerator function to the same field in the InputFromParent variable in the child PageGenerator function.

You have the following options for transferring parameters to the child PageGenerator function

Format Inside grid Child PageGenerator Parent PageGenerator
Variable Field Variable Value from
/(CHILDFNC-MyChild?ProdCode) No InputFromParent ProdCode WsyDetails Field: ProdCode
Yes InputFromParent ProdCode WsyGrid Field: ProdCode
/(CHILDFNC-MyChild?ProdCode=/[MyProdCode]) No InputFromParent ProdCode WsyDetails Field: MyProdCode
Yes InputFromParent ProdCode WsyGrid Field: MyProdCode
/(CHILDFNC-MyChild?ProdCode=A1234)

 

- InputFromParent ProdCode - Value: A1234

Finally, it is possible to add multiple parameters by separating each name-value pair with an ampersand:

/(CHILDFNC-MyChild?ProdCode1&ProdCode2=/[MyProdCode]&ProdCode3=A1234)