UserControls
UserControls are reusable components that can be used by many pages. They are perhaps the most interesting objects in the framework because the controls are what we interact with when we use the panel.
A UserControl is a set of smaller UI controls, which also contains all the presentation logic. Embedding this logic into the UserControl simplifies the configuration a lot. The interaction between fields (controls) and other event-driven logic must be implemented specifically into each control.
A page consists of many panels, a panel consists of one or more views, and a view consists of one or more control groups. Within a control group, it has its own controls.
UserControls, or GUI controls, are the building blocks of CRM.web webpage. Many of the UserControls are simple controls:
There are 2 types of lists in SuperOffice:
- SoListBox is a drop-down control that will display a flat list. It does not support categorized lists and searching.
- MDOList is the control that will support sub-list and search functionality. It supports categorized lists as well as searching.
The config file settings for both SoListBox and MDOList are similar. The MDO list control is the most widely used.
There are more complex controls like the ContactMainView
or the PersonDialogHeader
, which contains multiple simple controls. The controls are identified by the relevant config file and the actual objects will be mapped using the config file called SoObjectMapping.config.
You can also use placeholder controls.
Some of the web controls will be standard ASP.NET controls with the SuperOffice look, while others may be more complex and be dependent on data and services from the page framework, for example SoArchiveControl. All controls should implement a common interface for data binding and sentry, making it possible for them to be used outside web client context and be plugged into a back-end of another application.
Library
The controls are composed of ASPX files and C# code in the web control library named SuperOffice.Web.UI.Controls. These controls are custom controls that inherit from System.Web.UI.Control
and System.Web.UI.WebControl
control libraries from .NET Framework version 2.0.
SoObjectMapping.config
Since all rendering and building of pages depend on XML configuration files, we need a mechanism that maps the objects of the pages to the actual objects of the system. These config files contain details such from which assembly a specific user control is taken from.
<object type="Control"
mappingname="SoToolButton"
assemblyname="SuperOffice.CRMWeb"
objectname="SuperOffice.CRM.Web.UI.Controls.SoToolButton">
</object>
Parameter | Description |
---|---|
type | the type of the object |
mappingname | the name that this object is given in the other config files |
assemblyname | the assembly that this particular object resides in |
objectname | the actual name of the object inside the given assembly |
For example, the above code tells us the object that is represented by this line is referred to as SoToolButton in other config files, resides in the SuperOffice.CRMWeb assembly, and is called SuperOffice.CRM.Web.UI.Controls.SoToolButton
. The type tells us what role the object plays in the PageBuilder framework.
Once the object has been identified in the SoObjectMapping.config file, it could be used in any config file with statements like this:
<control id="selectionButton" type="SoToolButton">...</control>
PageBuilder config files
PageBuilder is the mechanism that is defined by SuperOffice to build the pages of the CRM.web application. The PageBuilder framework consists of different config files, including:
- Page config files
- Panel config files
- Card config files
- View config files
- Object mapping files
- Application config files
The PageBuilder uses these config files together with the current values from the SuperState to build the webpages that the user sees.