The form automatically generated by xaf is defined by two objects: A control called template and an abstract object window. The Query Form and listview are expressed by a combination of template and frame. The difference between window, frame and template is that window and frame do not contain the position information of the control but only the functional information of the xaf program. The template contains the location information of the control and determines the appearance of the window and frame.
Template
Template is the control that implements the iframetemplate and iwindowtemplate interfaces (I .e., template is control ). Iwindowtemplate inherits from iframetemplate. Compared with iframetemplate, iwindowtemplate provides additional status bar information storage, Template Name, and flag to determine whether the size can be changed. This makes the iwindowtemplate implementer look like a standard form. Built-in Templates include mainform and detailviewform under winform,
Popupform, lookupform, lookupcontroltemplate, nestedframetemplate; (under ASP. NET) default, defaultvertical, dialog, nestedframecontrol, login, error.
The built-in Template already contains location information such as actioncontainer and view, so that we do not have to make the UI from the beginning. For example, we set the category of simpleaction to "recordedit ", this action is displayed in the actioncontainer of recordedit.
Window and Frame
Frame is the parent class of window. The difference between a window and a frame is that a window is an independent UI element, while a frame has a parent. For example, mainform and detail form are defined by the window class, while the drop-down window is defined by the frame class.
The functions of frame and window are as follows:
1. Position of the View
Window itself does not make any sense. In the xaf program, it mainly uses window to access its view, and uses the window attribute frame. View to access the view. In addition, you may need to set a view to a window. The frame. setview method is used at this time.
2. Some custom operations can be performed when a frame or window is created.
When creating a frame or window, all suitable controllers are loaded and. the controllers collection is registered, and some operations are allowed by the event when the window or frame is created/deleted.