htmlinput
The htmplinput
widget is used to control the type and appearance of data input controls used for a field in a dynamic server page. It is mapped to the HTML <input>
element.
The html:type property determines whether the input control should be an edit box, check box, date picker, or other supported control.
Default Logical Widgets
Uniface provides the following default logical widgets that are mapped to the htmplinput
physical widget.
- EditBox—an input control of type
text
, which is displayed as a single-line text field for data entry. - Checkbox—an input control of type
checkbox
for setting a Boolean value. - CommandButton—an input control of type
button
for initiating an action. Because buttons are usually not editable, client syntax checking is disabled and the field syntax is explicitly set to non-editable. - CommandButton_updateable—an input control of type
button
for initiating an action. To enable browser-side changes to the text of the button, the button is editable, but client syntax checking is disabled. - DatePicker—an input control of type
date
, intended for entering a date and/or time value. It enables the user to select a date from a drop-down calendar. - Password—an input control of type
password
, which masks the data entered in the field. - NumberSpinnerBox—an input control of type
number
, for selecting a number within a range.
Triggers
- trigger detail—executed on click, or double-click when
detail=dblclick
is set - webtrigger onBlur—executed when the widget loses focus.
- webtrigger OnChange—executed when user changes the value. It may be fired several times when
html:type="date"
. - webtrigger onSyntaxError —executed in response to the OnChange event in browser.
- webtrigger onSyntaxErrorResolved —executed in response to the OnChange event in browser.
Supported Combinations of HTML Type and Data Type
The htmlinput
widget can be used with most Uniface data types, but not all data types are compatible with the selected HTML control type, as defined by the type property.
Some combinations of control type and data type are not supported, because the control cannot format the data correctly. When this occurs, a format error results and an exception is displayed in the web browser's console.
The type property can be set to any HTML-supported input control type, not just the ones for which Uniface has defined logical widgets. The following table shows valid control type and data type combinations, and indicates how data is formatted.
- ✓ Supported. Best match.
- ✓ Supported.
- C Supported. Data is formatted/deformatted on the browser.
- S Supported. Data is formatted on the server to be compatible with the control type.
- - Not supported. Data format is incompatible with HTML control type.
type of htmlinput |
Logical Widget | Data Types | |||||||
---|---|---|---|---|---|---|---|---|---|
S | B | N | F | D | T | DT | I | ||
button | CommandButton | ✓ | C | C | C | C | C | C | - |
checkbox | CheckBox | C | ✓ | C | C | - | - | - | - |
password | Password | ✓ | - | - | - | - | - | - | - |
text | EditBox | ✓ | C | C | C | C | C | C | - |
hidden | ✓ | - | - | - | - | - | - | - | |
radio | Not supported. Use RadioGroup widget |
- | - | - | - | - | - | - | - |
file, image, radio, reset | Not supported. | - | - | - | - | - | - | - | - |
HTML5-specific inputs: | |||||||||
date | DatePicker | ✓ | - | - | - | ✓ | - | - | - |
time | ✓ | - | - | - | - | ✓ | - | - | |
datetime | ✓ | - | - | - | - | - | ✓ | - | |
datetime-local | ✓ | - | - | - | - | - | ✓ | ||
month | ✓ | - | - | - | - | - | - | - | |
week | ✓ | - | - | - | - | - | - | - | |
number | NumberSpinnerBox | ✓ | - | ✓ | ✓ | - | - | - | - |
range | ✓ | - | ✓ | ✓ | - | - | - | - | |
color | ✓ | - | - | - | - | - | - | - | |
✓ | - | - | - | - | - | - | - | ||
tel | ✓ | - | - | - | - | - | - | - | |
url | ✓ | - | - | - | - | - | - | - | |
search | ✓ | - | - | - | - | - | - | - |
Widget Properties
For information on widgets and the types of widget properties, see and Widgets for Dynamic Server Pages and Widget Properties for the Dynamic Server Page.
HTML Properties
The htmlinput
supports the html:type property (which is set by each logical widget mapped to this physical widget), as well as the following HTML properties:
Property | Technical Name | Description |
---|---|---|
HTML Type | html:type
|
html:type |
Access Key | html:accesskey
|
accesskey |
Style Class | html:class
|
class |
Disable the Widget | html:disabled
|
disabled |
Read Only | html:readonly
|
readonly |
Tab Index | html:tabindex
|
tabindex |
Tool Tip Text | html:title
|
title |
Uniface Properties
The following properties represent Uniface properties that have no equivalent in HTML or CSS, or which are used when a form is converted to a DSP.
Uniface Property | Technical Name |
---|---|
Background Color (BackColor) | backcolor |
Syntax Check on Browser (ClientSyntaxCheck) | clientsyntaxcheck |
Foreground Color (ForeColor) | forecolor |
class:ClassName | class:ClassName
|
RenderingIncrement | renderingincrement |
CSS Properties
The following tables described the supported CSS properties that can be used to style the htmlinput
widget and the logical widgets that map to it.