Here's how the PageAutomation system works, and maybe it will make it all more clear. Note that, even in higher builders like the View and Form, all these steps still happen. The higher level Builders just wrap the Imported Page and Data Page Builders (and usually others) in a neater package.
- Data Page is handed a "virtual schema" and it builds a representation of it in Java objects, PageDataContainers and PageDataLeafs (collectively, PageDataElements). It also is handed a page on which to operate, but it doesn't do anything with it yet. This tree of data is kept in the WebApp with the Page. (By "virtual schema" I mean something that acts as a schema, defining the shape of the data. It can use a real schema, some sample XML, or even a Java Bean.)
- The Modifier Builders all get a chance to operate. Note that they only affect the internal represetation, the PageDataContainers and PageDataLeafs, setting different properties and values, sometimes rearranging the objects, and even adding new ones (as in the Data Hierarchy Modifier). Note that this is a published API, and you can create your own PageAutomation Builders which modify the PageDataElements.
- The PageAutomation controller (actually called a GenHandler) then processes each page. The steps are:
Match up any active (i.e. not hidden) PageDataElements, by name, to any named HTML Elements on the page.
(Assuming "Should Make UI" is set), build an HTML framework for all the active PageDataElements. This is a recursive process where each PageDataElement is given a spot to put its HTML (for columns, two spots, one for header and one for data). Each PageDataElement looks for an HTML Template and picks out a construct that is most appropriate for it. It clones the construct and sticks it in the spot it was given. For a Container element, it recurses this process, telling its children to create their own HTML, pointing to the appropriate spot within the HTML it just made for itself.
If the Data Page had requested that the page be exported. It will be exported here.
Another recursive process invokes all the Builders for each PageDataElement. i.e. if it has been designated a Text Input field, it will invoke the Text Input Builder, etc. Any PageDataElement with a label will invoke a Text builder for the label. For containers, if they repeat, they will invoke a Repeated Region builder on the appropriate spot. Containers then recurse to their children.
Yet another recursive process is invoked for any Data Entry Pages, to build the DataSave and Initialize methods.
- The Pages are exported to JSP.
Note that all of this happens long before the end-user is interacting with the application which the model generates. So there is no data available, only the definition of the data. Once the user is interacting with the application, the "Generation" of the Model has been long completed, the JSP and Java has been written and compiled, and it is just a regular JSP/Java application.