Online documentation - Websydian v6.5 |
Introduction Implementing Other Uses Valuespace Access Background
This page explains some consequences of using the Script Generation option for Page Generators when developing Websydian server-side scripting applications.
Using the parent and child utility patterns with server-side scripting is a little different from using these patterns in standard Websydian development. See the Working with Parent and Child Functions in a Server-Side Scripting Environment section of the Other Uses of the Parent and Child Page Generator Patterns page.
As the PageGeneratorWithErrorList pattern is a Parent Page Generator function the same steps as described in Using the Parent/Child Page Generator Patterns must be applied.
Page Generator functions inheriting from PageGeneratorWithErrorList calls the Child Page Generator function HtmlChildErrorPage. As this function is not a Script Page Generator function, a new ScriptChildErrorPage function inheriting from HtmlChildErrorPage must be defined. In addition to this remember to set the script option on the ScriptChildErrorPage function and replace HtmlChildErrorPage with ScriptChildErrorPage on all functions inheriting from PageGeneratorWithErrorList.
ScriptChildPageGenerator |
is a FNC |
HtmlChildErrorPage |
option NME |
ASP Generation |
|
impl name NME file name NME |
AspErr AspErr |
|
MyPageGeneratorWithErrorList |
is a FNC |
PageGeneratorWithErrorList |
replaces FNC |
HtmlChildErrorPage |
|
option NME |
ASP Generation |
The PageGeneratorWithErrorList is a special Parent Page Generator since it will only call the Child Error Page (HtmlChildErrorPage) if an error occurred on the previous page. This means that the sub space representing the ErrorPage only will be created in case of an error. Therefore the script code that generates the error list should be enclosed in an If block that tests whether or not the sub space exists.
Example:
...
AspErr_SignVS = AspErr_NVS.GetSubSpace("EventSignatures");
if (AspErr_SignVS != null ) { 'Added code
%>
<TABLE BORDER=1>
...
</TABLE>
<%}%> 'Added code
...
In some Page Generator functions, the value of fields in the WsyDetails variable may change during generation of the HTML page. In this way, the value of a WsyDetails field may be changed during Grid generation so that the field value before Grid generation is different from the field value after Grid generation.
Using Server-Side Scripting, the WsyDetails fields will always contain the post-Grid values.
The PageGeneratorWithJavaScripting pattern will include JavaScript for initialization of status values in List, Combo, Radio, and Check controls. This initialization will be performed automatically when working with Server-Side Scripting in Websydian, and the inheritance from the PageGeneratorWithJavaScripting pattern is no longer necessary.
This allows an elegant solution for initializing I-Mode compatible pages, as the I-Mode standard does not support JavaScript. Initialization of I-Mode compatible pages can then be accomplished using Server-Side Scripting.