Enum ListGridFieldType
- All Implemented Interfaces:
ValueEnum,Serializable,Comparable<ListGridFieldType>,Constable
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionFields of this type can contain any data value and have no default formatting or validation behavior.For viewing, the grid renders a 'view' icon (looking glass) followed by a 'download' icon and then the name of the file is displayed in text.For viewing and editing a checkbox is shown with a check mark for thetruevalue and no check mark for thefalsevalue.Field value should be aDateinstance representing a logical date, with no time of day information.Field value should be aDateinstance representing a specific date and time value.A floating point (decimal) number, e.g.Showsfield.iconin every cell, and also in the header.Renders a different image in each row based on the value of the field.Same asbinaryA whole number, e.g.Renders a clickable html link (using an HTML anchor tag: <A>).A float number with locale-based formatting and using currency symbol, e.g.A float number with locale-based formatting, e.g.An integer number with locale-based formatting, e.g.A telephone number.Same astextShow a calculated summary based on other field values within the current record.Simple text rendering for view.Field value should be aDateinstance representing a logical time, meaning time value that does not have a specific day and also has no timezone. -
Method Summary
Modifier and TypeMethodDescriptiongetValue()static ListGridFieldTypeReturns the enum constant of this type with the specified name.static ListGridFieldType[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
Enum Constant Details
-
TEXT
Simple text rendering for view. For editing a text entry field is shown. If the length of the field (as specified by theDataSourceField.lengthattribute) is larger than the value specified byListGrid.longTextEditorThreshold, a text input icon is shown that, when clicked on (or field is focused in) opens a larger editor that expands outside the boundaries of the cell (textarea by default, but overrideable viaListGrid.longTextEditorType).If this enumerated value is used in a
Component XMLfile or server-side DataSource descriptor (.ds.xml file), use the value "text". -
BOOLEAN
For viewing and editing a checkbox is shown with a check mark for thetruevalue and no check mark for thefalsevalue. This behavior may be suppressed by settingListGridField.suppressValueIconfor the field. SeeListGrid.booleanTrueImagefor customization.If this enumerated value is used in a
Component XMLfile or server-side DataSource descriptor (.ds.xml file), use the value "boolean". -
INTEGER
A whole number, e.g.123. Consider settingeditorTypeto use aSpinnerItem.If this enumerated value is used in a
Component XMLfile or server-side DataSource descriptor (.ds.xml file), use the value "integer". -
FLOAT
A floating point (decimal) number, e.g.1.23. Consider settingeditorTypeto use aSpinnerItem.If this enumerated value is used in a
Component XMLfile or server-side DataSource descriptor (.ds.xml file), use the value "float". -
DATE
Field value should be aDateinstance representing a logical date, with no time of day information. SeeDateFormatAndStoragefor details of the logical date type and how it is represented and manipulated.Dates will be formatted using
ListGridField.dateFormatterif specified, otherwiseListGrid.dateFormatter. If both these attributes are unset, dates are formatted using the standardshort display formatfor dates.For editing, by default a
DateItemis used withDateItem.useTextFieldset to true, providing textual date entry plus a pop-up date picker. ThedateFormatterandinputFormatfor the editor will be picked up from the ListGridField, if specified.If this enumerated value is used in a
Component XMLfile or server-side DataSource descriptor (.ds.xml file), use the value "date". -
TIME
Field value should be aDateinstance representing a logical time, meaning time value that does not have a specific day and also has no timezone. SeeDateFormatAndStoragefor details of the logical time type and how it is represented and manipulated.Times will be formatted using
ListGridField.timeFormatterif specified, otherwiseListGrid.timeFormatter.If both these attributes are unset, times are formatted using the standard String for times.
For editing, by default a
TimeItemis used. ThetimeFormatterfor the editor will be picked up from the ListGridField, if specified.If this enumerated value is used in a
Component XMLfile or server-side DataSource descriptor (.ds.xml file), use the value "time". -
DATETIME
Field value should be aDateinstance representing a specific date and time value. SeeDateFormatAndStoragefor details of the datetime type and how it is represented and manipulated.Dates will be formatted using
ListGridField.dateFormatterif specified, otherwiseListGrid.datetimeFormatter. If both these attributes are unset, dates are formatted using the standardshort display formatfor datetime values.For editing, by default a
DateTimeItemis used, providing textual date entry plus a pop-up date picker. ThedateFormatterandinputFormatfor the editor will be picked up from the ListGridField, if specified.If this enumerated value is used in a
Component XMLfile or server-side DataSource descriptor (.ds.xml file), use the value "datetime". -
SEQUENCE
Same astextIf this enumerated value is used in a
Component XMLfile or server-side DataSource descriptor (.ds.xml file), use the value "sequence". -
LINK
Renders a clickable html link (using an HTML anchor tag: <A>). The target URL is the value of the field, which is also the default display value. You can override the display value by settingListGridRecord.linkTextorListGridField.linkText.Clicking the link opens the URL in a new window by default. To change this behavior, you can set
field.target, which works identically to the "target" attribute on an HTML anchor (<A>) tag. SeeListGridField.targetfor more information.In inline edit mode, this type works like a text field.
To create a link not covered by this feature, consider using
ListGridField.setCellFormatter()along withCanvas.linkHTML(), or simplystyling the fieldto look like a link, and providing interactivity viafield.recordClick().If this enumerated value is used in a
Component XMLfile or server-side DataSource descriptor (.ds.xml file), use the value "link". -
IMAGE
Renders a different image in each row based on the value of the field. If this URL is not absolute, it is assumed to be relative toListGridField.imageURLPrefixif specified. The size of the image is controlled byListGridField.imageSize,ListGridField.imageWidth,ListGridField.imageHeight(and by the similarly-named global default attributes on the ListGrid itself).You can also specify the following attributes on the field:
activeAreaHTML, andextraStuff- these are passed toCanvas.imgHTML()to generate the final URL.Note if you want to display icons in addition to the normal cell value, you can use
valueIconsinstead.If this enumerated value is used in a
Component XMLfile or server-side DataSource descriptor (.ds.xml file), use the value "image". -
ICON
Showsfield.iconin every cell, and also in the header. Useful for a field that is used as a button, for example, launches a detail window or removes a row. Implement afield.recordClickto define a behavior for the button.NOTE: for a field that shows different icons depending on the field value, see
ListGridField.valueIcons.type:"icon"also defaults to a small field width, accommodating just the icon with padding, and to a blank header title, so that the header shows the icon only.field.iconWidthand related properties configure the size of the icon both in the header and in body cells.If you want the icon to appear only in body cells and not in the header, set
field.cellIconinstead, leaving field.icon null.If this enumerated value is used in a
Component XMLfile or server-side DataSource descriptor (.ds.xml file), use the value "icon". -
BINARY
For viewing, the grid renders a 'view' icon (looking glass) followed by a 'download' icon and then the name of the file is displayed in text. If the user clicks the 'view' icon, a new browser window is opened and the file is streamed to that browser instance, usingDataSource.viewFile(). For images and other file types with known handlers, the content is typically displayed inline - otherwise the browser will ask the user how to handle the content. If the download icon is clicked,DataSource.downloadFile()is used to cause the browser to show a "save" dialog. There is no inline editing mode for this field type.If this enumerated value is used in a
Component XMLfile or server-side DataSource descriptor (.ds.xml file), use the value "binary". -
IMAGEFILE
Same asbinaryIf this enumerated value is used in a
Component XMLfile or server-side DataSource descriptor (.ds.xml file), use the value "imageFile". -
SUMMARY
Show a calculated summary based on other field values within the current record. SeeListGridField.recordSummaryFunctionfor more informationIf this enumerated value is used in a
Component XMLfile or server-side DataSource descriptor (.ds.xml file), use the value "summary". -
ANY
Fields of this type can contain any data value and have no default formatting or validation behavior. This is useful as theparent typefor SimpleTypes where you do not want any of the standard validation or formatting logic to be inherited from the standard built-in types.If this enumerated value is used in a
Component XMLfile or server-side DataSource descriptor (.ds.xml file), use the value "any". -
LOCALEINT
An integer number with locale-based formatting, e.g.12,345,678. SeeLocalized Number Formattingfor more info.If this enumerated value is used in a
Component XMLfile or server-side DataSource descriptor (.ds.xml file), use the value "localeInt". -
LOCALEFLOAT
A float number with locale-based formatting, e.g.12,345.67. SeeLocalized Number Formattingfor more info.If this enumerated value is used in a
Component XMLfile or server-side DataSource descriptor (.ds.xml file), use the value "localeFloat". -
LOCALECURRENCY
A float number with locale-based formatting and using currency symbol, e.g.$12,345.67. SeeLocalized Number Formattingfor more info.If this enumerated value is used in a
Component XMLfile or server-side DataSource descriptor (.ds.xml file), use the value "localeCurrency". -
PHONENUMBER
A telephone number. UsesFormItem.browserInputType"tel" to hint to the device to restrict input. On most mobile devices that have software keyboards, this cause a specialized keyboard to appear which only allows entry of normal phone numbers. When displayed read-only, a "phoneNumber" renders as an HTML link with the "tel:" URL scheme, which will invoke the native phone dialing interface on most mobile devices. In addition, the CSS style "sc_phoneNumber" is applied.By default, "phoneNumber" fields do not include validators, however the following validator definition would limit to digits, dashes and the "+" character: xml:
<validator type="regexp" expression="^(\(?\+?[0-9]*\)?)?[0-9_\- \(\)]*$" errorMessage="Phone number should be in the correct format e.g. +#(###)###-##-##" />
or directly in Java:
RegExpValidator v = new RegExpValidator(); v.setType(ValidatorType.REGEXP); v.setErrorMessage("Phone number should be in the correct format e.g. +#(###)###-##-##"); v.setExpression("^(\\(?\\+?[0-9]*\\)?)?[0-9_\\- \\(\\)]*$");and adding "#" and "*" to the regular expressions above would allow for users to enter special keys sometimes used for extension numbers or pausesIf this enumerated value is used in a
Component XMLfile or server-side DataSource descriptor (.ds.xml file), use the value "phoneNumber".
-
-
Method Details
-
values
Returns an array containing the constants of this enum type, in the order they are declared.- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum type has no constant with the specified nameNullPointerException- if the argument is null
-
getValue
-