Customizing Widgets
Customizing widgets is a process that involves customizing the HTML that is produced to represent the value of a field. A client application developer defines a Cúram application page by using UIM, but the page is displayed in a user's web browser by using HTML.
Behind the scenes, the CDEJ translates the CLUSTER and LIST elements of the UIM page into HTML elements and then presents or renders the labels and values of the FIELD elements within the structure that is provided by those HTML elements. Typically, the CDEJ renders a cluster or list by using an HTML table and then places the labels and values of the fields into the cells of that table. The CDEJ renders the label of a field the same way for all fields, but renders the HTML for the value of a field in different ways depending on the type, the domain definition, of that field's value.
The processing of field values in a domain-specific manner has been available since Cúram 4.0. This support for custom data conversion and sorting is described in detail in the Cúram Web Client Reference Manual. Using the same configuration mechanism, the CDEJ now extends this domain-specific customization to the widgets used to produce the HTML for the values of fields. The CDEJ includes a default configuration that associates the provided Cúram widgets with all of the domain definitions of the application. The CDEJ now also supports these key features:
- The customization of the default configuration by the application developer, providing the freedom to change what widget is used to render the value of each type of field;
- The development of new widgets by the application developer and their integration into the application through the customization of the default configuration. These custom widgets allow full control over the rendering of values for individual UIM FIELD elements.
Custom widgets are integrated into the application in a manner that preserves all of the time-saving and simplifying features of UIM development. However, developing custom widgets can be a complex process. Widget developers take on the responsibility for considerations such as styling, internationalization, cross-browser support, and other concerns from which they are insulated when using UIM alone. There is a balance to be achieved between ease of development and maintenance on the one hand and user interface richness and flexibility on the other.
Cúram widgets and custom widgets differ only in where they are developed and configured, not how. Therefore, custom widgets are a powerful tool for application developers who need to meet challenging presentation requirements by complementing or replacing the provided Cúram widgets. The development and configuration of such custom widgets is the subject of the guide.