Developing Simple Custom Widgets

A widget controls how the value of a field is presented by adding the HTML mark-up to the value that is appropriate for that presentation. Reconfiguring the widgets associated with different domain definitions and restyling the HTML of existing widgets with custom CSS are not always sufficient to meet a presentation requirement. If the developer decides that the presentation requirement can only be satisfied by modifying the structure of the HTML produced for the value of a field in a manner that no existing widget can achieve, then the developer must write a new widget and configure it for use by the application.

An E-Mail Address Widget explains how to develop a simple widget for viewing the value of a field; A Text Field Widget with No Auto-completion explains how to develop a simple widget for editing the value of a field. Both chapters describe briefly how to configure these widgets and more information about the configuration of custom widget can be found in Configuring Renderers.

In the simple case, a widget will replace the HTML content produced for the value of a UIM FIELD within the context of a normal UIM CLUSTER or LIST. The value of the field will still be a single string, number or date, only styled more elaborately. The general layout of the page will not be affected. Where the presentation requirement has a wider scope and requires that the layout of significant parts of the page be changed, or that the value of a field contain many embedded values, such as in an XML document, a more complex widget will be required.