setTextFromTime

setTextFromTime(time: Time);

The setTextFromTime method of the JadeEditMask control class sets the text from the textUser property to a Time value converted to a string in the format of the locale under which the control is running (for details, see the languageId property). If the value of the mask property is null ("") or if it does not specify that the data is a time field with at least an hour and minutes mask (for example, hh:mm:ss), an exception is raised. If the mask does not have a seconds mask, the seconds in the time are ignored.

When the EnhancedLocaleSupport parameter in the [JadeEnvironment] section of the JADE initialization file on the database node is set to true, the JadeEditMask class validates the setting and entry of text based on the mask property, using the current locale of the client with regional overrides on both the presentation client and the application server.

The setTextFromTime method of the TextBox control class sets the text of the text box to the specified Time value converted to a string in the format of the current locale.

When the EnhancedLocaleSupport parameter is not defined or it is set to false, inconsistent results could be returned to the application server when running in JADE thin client mode and there are regional overrides, as all overrides on the application server are suppressed. By default, formatting of locale data is done on the application server, based on the locale of the corresponding presentation client. For example, if the locale of your application server is set to English (United Kingdom), which has a default short time format of HH:mm:ss (24-hour clock), and it has been overridden with a short time format of hh:mm:ss (12-hour clock), this is returned in the default HH:mm:ss format.

A JadeEditMask control expects times to be formatted according to the locale that the control is using. This applies when accessing the text or textUser property and when the user enters data. Setting time text by using the setTextFromTime method converts the time into the appropriate string for that locale.

Retrieving the Time value by using the getTextAsTime method does the reverse. You can therefore use the getTextAsTime and setTextFromTime methods to access time text so that JADE handles the locale format for you.