HTML5 controls vs DOJO in 9.7.01

Author: (Mike Taylor)

Uniface 9.7.01 has introduced a new DSP widget set - HTML5 controls Uniface is now configured to use these HTML5 widgets instead of the Dojo JavaScript widgets that were used in previous Uniface releases. With these widgets there are a number of changes that you should be aware of. The CSS is different – The Dojo widgets are, when rendered, quite complex with a single field normally being made up of a number of HTML elements. The CSS needed to style these widgets is also quite complex, however as the HTML5 widgets offer similar functionality in a simpler widget, the corresponding CSS is also simpler. Incremental search on DropDownLists – The Dojo widgets offer an incremental filter which is not available in the HTML5 equivalent control. Syntax Checking and error reporting – The Dojo widgets will check the syntax of the entered data as you modify the field and will report any errors in a balloon (which had many limitations when being being used on small devices with touch interfaces). For the HTML5 widgets a new bound element has been introduced (uflderror:) to receive the syntax error. To style the element and its corresponding data fields, Uniface will add CSS classes allowing the developer a way of displaying to the field’s error state. To improve usability further, a new client-side OnSyntaxError trigger has been added to react to the syntax error using JavaScript. The syntax checking now only happens when the user leaves the field rather than in-line as they type. DatePicker – Using a DatePicker widget causes a native date picker to be displayed on browsers that support the attribute type=“date” on input elements. The native date picker is especially important when viewing a page within a mobile browser. As a fallback for browsers not supporting the type=”date” attribute Uniface will set type=”string”. It is also possible to add a placeholder (in the layout or code) to the field to show how the date should be entered. By default, the HTML5 widgets communicate with typed data rather than as pre-formatted strings, meaning the Format/Deformat triggers are not fired. The display format is ignored, except for dates and NLS where the processing has been moved to the client. To change back to communicating with strings, you can use a new widget property of datatype=”string”. This property is set by default for the Dojo widgets. With the HTML5 widgets it is now possible use extended and custom attributes. These can be defined in definitions, layout or code - they are merged or overridden at runtime. For this reason, the type attribute is not added to input elements when using “copy as HTML”. This causes the html preview to render the widget as an EditBox, rather than a checkbox or command button. Excluding the type attribute from the layout makes it possible to update the widget’s type in field properties, without having to also change the layout. TIP: The new HTML5 widget-set is configured by default, however the Dojo ones can be re-enabled in the usys.ini file, where their definitions have been included but commented out.

This page has no comments.