Online documentation - WebsydianExpress v3.0 |
In many situations it is desirable to let a page contain a drop down box, which instead of being loaded with static values is loaded using a function accessing the database.
Websydian offers such a functionality. The way this is done in standard Websydian is described here.
This functionality is of course also offered in WebsydianExpress.
This section describes the implementation of a dynamically loaded drop down in WebsydianExpress, with focus on the things, which are different from the standard implementation.
The drop down box is basically just a special child page, which is being inserted on a parent page. The child page is created and the functions you need to generate is set to implement Yes using the following triples:
Source Object | Verb | Target Object |
---|---|---|
MyDropDown | is a FNC | WSYAPI/Abstract.HTML DropDownGeneratorForProcess |
implement SYS | Yes | |
MyDropDown. _DocumentTemplateGenerator |
implement SYS | Yes |
Inheriting from the WSYAPI/HTMLDropDwonGeneratorForProcess ensures that the generated template for the drop down box can be placed in the same folder as rest of the application - and that you can specify special behavior for the drop down based on the presentation used.
As all functions inheriting from PageGeneratorForProcess are automatically ParentPageGenerators the only thing needed is to include the drop down box in the page like this:
Source Object | Verb | Target Object |
---|---|---|
MyPageGenerator | comprises FNC | MyDropDown |
Generate, build and run the DocumentTemplateGenerator for MyDropDown. This generates the template for the drop down box - customize this as needed.
Generate, build and run the DocumentTemplateGenerator for MyPageGenerator. The generated template will contain a replacement marker specifying the implementation name of MyDropDown.
The child page created by MyDropDown will be inserted instead of this replacement marker at run time.