15. Writing a Template Assistant : How You Can Ensure Compatibility Between the Assistant and ApplyTemplate : How You Can Use ApplyTemplate on a Frame : How You Can Partition the Frame
 
Share this page                  
How You Can Partition the Frame
To solve the problem of applying template changes without affecting user changes, the ApplyTemplate utility assumes that the frame template assistant has been designed so that the generated frame is effectively partitioned into two areas:
That which belongs to and has been modified by the user
That which belongs to and has been modified by the frame template assistant that generated the frame
After the ApplyTemplate utility is used on a frame generated from a frame template assistant, the area belonging to the user is not touched, but the area belonging to the frame template assistant is completely overwritten, and any changes made by a user to that area is lost.
A frame consists of three major parts: a form, a 4GL script, and a menu. For the purposes of the ApplyTemplate utility, each has a clearly defined boundary separating the user area from the frame template assistant area.
The boundary separating the two areas on the frame's form is defined by a high-level composite field that resides on the form of both the frame template and the frames that are created from it. Thus, on the form of frames created from the frame template, anything inside the high-level composite field belongs to the frame template assistant, and anything outside of it belongs to the user.