Class TimeItem
- All Implemented Interfaces:
HasHandlers
,HasBlurHandlers
,HasChangedHandlers
,HasChangeHandlers
,HasClickHandlers
,HasDoubleClickHandlers
,HasEditorEnterHandlers
,HasEditorExitHandlers
,HasFocusHandlers
,HasIconClickHandlers
,HasIconKeyPressHandlers
,HasItemHoverHandlers
,HasKeyDownHandlers
,HasKeyPressHandlers
,HasKeyUpHandlers
,HasPendingStatusChangedHandlers
,HasPickerIconClickHandlers
,HasShowContextMenuHandlers
,HasTitleClickHandlers
,HasTitleDoubleClickHandlers
,HasTitleHoverHandlers
,HasValueHoverHandlers
,HasValueIconClickHandlers
FormItem
for editing logical-time
values, which
are Date instances where only the time-portion is relevant.
The item renders with one of two appearances, depending on the value of
useTextField
- when set to true, the default
appearance, times are edited
directly as text-values. In this mode, values are formatted according to
timeFormatter
, with defaults coming from
timeFormatter24Hour
and timeFormatter12Hour
, depending on
the value of
use24HourTime
.
See also String for system-wide settings.
TimeItem automatically accepts both 12 and 24 hour time as well as partial times and a variety of possible time value separators. Examples:
11:34:45 AM => 11:34:45 1:3:5 AM => 01:30:50 1:3p => 13:30:00 11 34 am => 11:34:00 11-34 => 11:34:00 113445 => 11:34:45 13445 => 01:34:45 1134 => 11:34:00 134 => 01:34:00
When useTextField
is set to false, the item provides separate pickers for
hour
, minute
and
second
values. By default, the pickers edit
times in
24-hour format
, meaning the
hourItem
shows
values from 0-23. When use24HourTime
is set
to false, the
hourItem
is limited to a range of 1-12, and the
am/pm picker
is displayed. Note that
getValue()
always returns a Date instance that
represents a
logical-time
in 24-hour format.
Values entered by the user are stored as JavaScript Date
objects in local time.
The day, month and year values of this Date
object are not relevant and should
be ignored.
By default, when used in a SearchForm
or as a field in a ListGrid
's
filter editor
, TimeItems will automatically
generate
AdvancedCriteria - for example, entering "11:00" into the item will generate a
betweenInclusive
Criterion that selects all times between
11:00:00 and 11:59:59. If the form is databound and the DataSource is marked as being
allowAdvancedCriteria
:false, the criteria generated
will be simple, checking for data with logical time values equal to the displayed value.
To edit logical-Date values
, see DateItem
,
and to edit datetime values
, see DateTimeItem
.
For relative-date features
, see RelativeDateItem
.
For detailed information on working with dates, times and datetimes, see the
Date and Time Format and Storage overview
.
-
Nested Class Summary
Nested classes/interfaces inherited from class com.smartgwt.client.widgets.form.fields.FormItem
FormItem.CustomStateGetter, FormItem.StateCustomizer
-
Field Summary
Fields inherited from class com.smartgwt.client.widgets.form.fields.FormItem
configOnly, scClassName, warnOnEditorTypeConversion, warnOnEditorTypeConversionDefault
Fields inherited from class com.smartgwt.client.core.RefDataClass
id
Fields inherited from class com.smartgwt.client.core.DataClass
factoryCreated, factoryProperties
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
changeAutoChildDefaults
(String autoChildName, Canvas defaults) Changes the defaults for Canvas AutoChildren namedautoChildName
.static void
changeAutoChildDefaults
(String autoChildName, FormItem defaults) Changes the defaults for FormItem AutoChildren namedautoChildName
.static void
changePickerIconDefaults
(FormItemIcon defaults) void
IfuseTextField
is true, falls through to standarddeselectValue()
implementation on this items freeform text entry field.void
deselectValue
(Boolean start) IfuseTextField
is true, falls through to standarddeselectValue()
implementation on this items freeform text entry field.Select item to hold the AM/PM value for the timeItem whenuseTextField
is false.Custom properties to apply to this timeItem's generatedAM/PM picker
.Title to show for theAM/PM picker
.IfuseTextField
is true and browserInputType is set to "time", then a native HTML5 time input is used in place of a text input.Deprecated.int
WhenuseTextField
is set to false, this method returns the value of the time expressed as a duration in thetimeUnit
provided.int
getDuration
(TimeUnit timeUnit) WhenuseTextField
is set to false, this method returns the value of the time expressed as a duration in thetimeUnit
provided.Returns the raw text value typed into this items text field ifuseTextField
is true (otherwise returns the result of this.getValue()).WhenuseTextField
is false andhourValues
is unset, this attribute specifies the increment to use when generating entries for the hour picker.Select item to hold the hours portion of the time orduration
whenuseTextField
is false.The hover prompt to show for thehour picker
.Custom properties to apply to this timeItem's generatedhour picker
.Title to show for thehour picker
.WhenuseTextField
is false andhourValues
is unset, this attribute specifies the maximum value present in the hour picker.WhenuseTextField
is false andhourValues
is unset, this attribute specifies the minimum value present in the hour picker.int[]
An array of values to make available in thehour picker
whenuseTextField
is false.Validation error message to display if the user enters an invalid time string.WhenuseTextField
is false, the default title-alignment of child-items such as thehour
,minute
andsecond
pickers, within their cells.WhenuseTextField
is false, the default orientation of titles for child-items, such as thehour
,minute
andsecond
pickers.WhenuseTextField
is false andmillisecondValues
is unset, this attribute specifies the increment to use when generating entries for the millisecond picker.Select item to hold the milliseconds portion of the time orduration
whenuseTextField
is false.The hover prompt to show for themillisecond picker
.Custom properties to apply to this timeItem's generatedmillisecond picker
.Title to show for themillisecond picker
.WhenuseTextField
is false andmillisecondValues
is unset, this attribute specifies the maximum value present in the millisecond picker.WhenuseTextField
is false andmillisecondValues
is unset, this attribute specifies the minimum value present in the millisecond picker.int[]
An array of values to make available in themillisecond picker
whenuseTextField
is false.WhenuseTextField
is false andminuteValues
is unset, this attribute specifies the increment to use when generating entries for the minute picker.Select item to hold the minutes portion of the time orduration
whenuseTextField
is false.The hover prompt to show for theminute picker
.Custom properties to apply to this timeItem's generatedminute picker
.Title to show for theminute picker
.WhenuseTextField
is false andminuteValues
is unset, this attribute specifies the maximum value present in the minute picker.WhenuseTextField
is false andminuteValues
is unset, this attribute specifies the minimum value present in the minute picker.int[]
An array of values to make available in theminute picker
whenuseTextField
is false.static TimeItem
getOrCreateRef
(JavaScriptObject jsObj) WhenuseTextField
is false andsecondValues
is unset, this attribute specifies the increment to use when generating entries for the second picker.Select item to hold the seconds portion of the time orduration
whenuseTextField
is false.The hover prompt to show for thesecond picker
.Custom properties to apply to this timeItem's generatedseconds picker
.Title to show for thesecond picker
.WhenuseTextField
is false andsecondValues
is unset, this attribute specifies the maximum value present in the second picker.WhenuseTextField
is false andsecondValues
is unset, this attribute specifies the minimum value present in the second picker.int[]
An array of values to make available in thesecond picker
whenuseTextField
is false.int[]
IfuseTextField
is true, falls through to standardcom.smartgwt.client.widgets.form.fields.FormItem#getSelectionRange
implementation on this item's freeform text entry field.IfuseTextField
is true and ahint
is set, should the hint be shown within the field?Controls whether to display thehourItem
whenuseTextField
is false.WhenuseTextField
is false, whether titles should be shown for for child-items in this TimeItem.Controls whether to display themillisecondItem
whenuseTextField
is false.Controls whether to display theminuteItem
whenuseTextField
is false.Controls whether to display thesecondItem
whenuseTextField
is false.IfuseTextField
istrue
, this property governs the alignment of text within the text field.Base CSS class for this item's text box.Text field to hold the entire time in "type in" format, ifuseTextField
is true.Custom properties to apply to thetext field
generated for this timeItem whenuseTextField
is true.IfuseTextField
is true, what format should this item's time string be presented in?IfuseTextField
is true, anduse24HourTime
is false, what format should this item's time string be presented in?IfuseTextField
is true, anduse24HourTime
is true, what format should this item's time string be presented in?Whether to enforce 24-hour time in the UI.If true, a data entry mask will be enabled in the field based on thetimeFormatter
.boolean
Ifshowing the hint in field
and if supported by the browser, should the HTML5placeholder
attribute be used to display the hint within the field? If set tofalse
, then use of theplaceholder
attribute is disabled and an alternative technique to display the hint in-field is used instead.Should we show the time in a text field, or as a number of SelectItems?Return the value tracked by this form item.If this item is showing aFormItem.hint
, should the hint text be allowed to wrap? Setting this property tofalse
will render the hint on a single line without wrapping, expanding the width required to render the item if necessary.boolean
pendingStatusChanged
(DynamicForm form, FormItem item, boolean pendingStatus, Object newValue, Object value) Notification method called whenshowPending
is enabled and this time item should either clear or show its pending visual state.void
IfuseTextField
is true, falls through to standardselectValue()
implementation on this items freeform text entry field.setAmpmItemProperties
(SelectItem ampmItemProperties) Custom properties to apply to this timeItem's generatedAM/PM picker
.setAmpmItemTitle
(String ampmItemTitle) Title to show for theAM/PM picker
.setBrowserInputType
(String browserInputType) IfuseTextField
is true and browserInputType is set to "time", then a native HTML5 time input is used in place of a text input.static void
setDefaultProperties
(TimeItem timeItemProperties) Class level method to set the default properties of this class.void
setDisplayFormat
(TimeDisplayFormat timeFormatter) Deprecated.UsegetTimeFormatter()
instead.void
setDisplayFormat
(TimeFormatter timeFormatter) Deprecated.UsesetDisplayFormat(TimeDisplayFormat)
instead.setHourIncrement
(Integer hourIncrement) WhenuseTextField
is false andhourValues
is unset, this attribute specifies the increment to use when generating entries for the hour picker.setHourItemPrompt
(String hourItemPrompt) The hover prompt to show for thehour picker
.setHourItemProperties
(SelectItem hourItemProperties) Custom properties to apply to this timeItem's generatedhour picker
.setHourItemTitle
(String hourItemTitle) Title to show for thehour picker
.setHourMaxValue
(Integer hourMaxValue) WhenuseTextField
is false andhourValues
is unset, this attribute specifies the maximum value present in the hour picker.setHourMinValue
(Integer hourMinValue) WhenuseTextField
is false andhourValues
is unset, this attribute specifies the minimum value present in the hour picker.void
setHours
(int hours) Set the hour value of this TimeItem.setHourValues
(int... hourValues) An array of values to make available in thehour picker
whenuseTextField
is false.setInvalidTimeStringMessage
(String invalidTimeStringMessage) Validation error message to display if the user enters an invalid time string.setItemTitleAlign
(Alignment itemTitleAlign) WhenuseTextField
is false, the default title-alignment of child-items such as thehour
,minute
andsecond
pickers, within their cells.setItemTitleOrientation
(TitleOrientation itemTitleOrientation) WhenuseTextField
is false, the default orientation of titles for child-items, such as thehour
,minute
andsecond
pickers.setMillisecondIncrement
(Integer millisecondIncrement) WhenuseTextField
is false andmillisecondValues
is unset, this attribute specifies the increment to use when generating entries for the millisecond picker.setMillisecondItemPrompt
(String millisecondItemPrompt) The hover prompt to show for themillisecond picker
.setMillisecondItemProperties
(SelectItem millisecondItemProperties) Custom properties to apply to this timeItem's generatedmillisecond picker
.setMillisecondItemTitle
(String millisecondItemTitle) Title to show for themillisecond picker
.setMillisecondMaxValue
(Integer millisecondMaxValue) WhenuseTextField
is false andmillisecondValues
is unset, this attribute specifies the maximum value present in the millisecond picker.setMillisecondMinValue
(Integer millisecondMinValue) WhenuseTextField
is false andmillisecondValues
is unset, this attribute specifies the minimum value present in the millisecond picker.void
setMilliseconds
(int milliseconds) Set the milliseconds value of this TimeItem.setMillisecondValues
(int... millisecondValues) An array of values to make available in themillisecond picker
whenuseTextField
is false.setMinuteIncrement
(Integer minuteIncrement) WhenuseTextField
is false andminuteValues
is unset, this attribute specifies the increment to use when generating entries for the minute picker.setMinuteItemPrompt
(String minuteItemPrompt) The hover prompt to show for theminute picker
.setMinuteItemProperties
(SelectItem minuteItemProperties) Custom properties to apply to this timeItem's generatedminute picker
.setMinuteItemTitle
(String minuteItemTitle) Title to show for theminute picker
.setMinuteMaxValue
(Integer minuteMaxValue) WhenuseTextField
is false andminuteValues
is unset, this attribute specifies the maximum value present in the minute picker.setMinuteMinValue
(Integer minuteMinValue) WhenuseTextField
is false andminuteValues
is unset, this attribute specifies the minimum value present in the minute picker.void
setMinutes
(int minutes) Set the minute value of this TimeItem.setMinuteValues
(int... minuteValues) An array of values to make available in theminute picker
whenuseTextField
is false.setSecondIncrement
(Integer secondIncrement) WhenuseTextField
is false andsecondValues
is unset, this attribute specifies the increment to use when generating entries for the second picker.setSecondItemPrompt
(String secondItemPrompt) The hover prompt to show for thesecond picker
.setSecondItemProperties
(SelectItem secondItemProperties) Custom properties to apply to this timeItem's generatedseconds picker
.setSecondItemTitle
(String secondItemTitle) Title to show for thesecond picker
.setSecondMaxValue
(Integer secondMaxValue) WhenuseTextField
is false andsecondValues
is unset, this attribute specifies the maximum value present in the second picker.setSecondMinValue
(Integer secondMinValue) WhenuseTextField
is false andsecondValues
is unset, this attribute specifies the minimum value present in the second picker.void
setSeconds
(int seconds) Set the seconds value of this TimeItem.setSecondValues
(int... secondValues) An array of values to make available in thesecond picker
whenuseTextField
is false.void
setSelectionRange
(int start, int end) IfuseTextField
is true, falls through to standardsetSelectionRange
implementation on this items freeform text entry field.setShowHintInField
(Boolean showHintInField) IfuseTextField
is true and ahint
is set, should the hint be shown within the field?setShowHourItem
(Boolean showHourItem) Controls whether to display thehourItem
whenuseTextField
is false.setShowItemTitles
(Boolean showItemTitles) WhenuseTextField
is false, whether titles should be shown for for child-items in this TimeItem.setShowMillisecondItem
(Boolean showMillisecondItem) Controls whether to display themillisecondItem
whenuseTextField
is false.setShowMinuteItem
(Boolean showMinuteItem) Controls whether to display theminuteItem
whenuseTextField
is false.setShowSecondItem
(Boolean showSecondItem) Controls whether to display thesecondItem
whenuseTextField
is false.setTextAlign
(Alignment textAlign) IfuseTextField
istrue
, this property governs the alignment of text within the text field.setTextBoxStyle
(String textBoxStyle) Base CSS class for this item's text box.setTextFieldProperties
(TextItem textFieldProperties) Custom properties to apply to thetext field
generated for this timeItem whenuseTextField
is true.setTimeFormatter
(TimeDisplayFormat timeFormatter) IfuseTextField
is true, what format should this item's time string be presented in?setTimeFormatter12Hour
(TimeDisplayFormat timeFormatter12Hour) IfuseTextField
is true, anduse24HourTime
is false, what format should this item's time string be presented in?setTimeFormatter24Hour
(TimeDisplayFormat timeFormatter24Hour) IfuseTextField
is true, anduse24HourTime
is true, what format should this item's time string be presented in?setUse24HourTime
(Boolean use24HourTime) Whether to enforce 24-hour time in the UI.setUseMask
(Boolean useMask) If true, a data entry mask will be enabled in the field based on thetimeFormatter
.setUsePlaceholderForHint
(boolean usePlaceholderForHint) Ifshowing the hint in field
and if supported by the browser, should the HTML5placeholder
attribute be used to display the hint within the field? If set tofalse
, then use of theplaceholder
attribute is disabled and an alternative technique to display the hint in-field is used instead.setUseTextField
(Boolean useTextField) Should we show the time in a text field, or as a number of SelectItems?setWrapHintText
(Boolean wrapHintText) If this item is showing aFormItem.hint
, should the hint text be allowed to wrap? Setting this property tofalse
will render the hint on a single line without wrapping, expanding the width required to render the item if necessary.Methods inherited from class com.smartgwt.client.widgets.form.fields.FormItem
_getValue, addBlurHandler, addChangedHandler, addChangeHandler, addClickHandler, addDoubleClickHandler, addEditorEnterHandler, addEditorExitHandler, addFocusHandler, addIcon, addIcon, addIconClickHandler, addIconKeyPressHandler, addItemHoverHandler, addKeyDownHandler, addKeyPressHandler, addKeyUpHandler, addPendingStatusChangedHandler, addPickerIconClickHandler, addShowContextMenuHandler, addTitleClickHandler, addTitleDoubleClickHandler, addTitleHoverHandler, addValueHoverHandler, addValueIconClickHandler, applyFormula, asSGWTComponent, blurItem, canEditCriterion, checkFormItemType, clearErrors, clearValue, disable, disableIcon, enable, enableIcon, error, error, errorIfNotCreated, focusAfterItem, focusInItem, getAccessKey, getAlign, getAllowExpressions, getAlwaysFetchMissingValues, getAlwaysShowControlBox, getApplyAlignToText, getApplyHeightToTextBox, getAriaRole, getAttribute, getAttributeAsBoolean, getAttributeAsBoolean, getAttributeAsDate, getAttributeAsDouble, getAttributeAsFloat, getAttributeAsInt, getAttributeAsJavaScriptObject, getAttributeAsObject, getAttributeAsString, getAutoComplete, getAutoCompleteKeywords, getBrowserSpellCheck, getCanEdit, getCanEditOpaqueValues, getCanFocus, getCanHover, getCanSelectText, getCanTabToIcons, getCanvasAutoChild, getCellHeight, getCellStyle, getChangeOnKeypress, getClassName, getClipStaticValue, getClipTitle, getConfig, getContainerWidget, getControlStyle, getCriteriaField, getCriterion, getCriterion, getCursorPosition, getCustomState, getDataPath, getDateFormatter, getDecimalPad, getDecimalPrecision, getDefaultIconSrc, getDefaultOperator, getDefaultValue, getDestroyed, getDisabled, getDisabledHover, getDisableIconsOnReadOnly, getDisplayField, getDisplayFieldName, getDisplayValue, getDisplayValue, getEditorTypeConfig, getEditPendingCSSText, getEditProxyConstructor, getEmptyDisplayValue, getEmptyValueIcon, getEndRow, getErrorIconHeight, getErrorIconProperties, getErrorIconSrc, getErrorIconWidth, getErrorMessageWidth, getErrors, getEscapeHTML, getExportFormat, getFetchMissingValues, getFieldName, getFilterLocally, getForeignDisplayField, getForm, getFormat, getFormItemAutoChild, getFormula, getFullDataPath, getGlobalTabIndex, getGridColNum, getGridRowNum, getHeight, getHeightAsString, getHidden, getHint, getHintStyle, getHoverAlign, getHoverDelay, getHoverFocusKey, getHoverHeight, getHoverHeightAsString, getHoverOpacity, getHoverPersist, getHoverStyle, getHoverVAlign, getHoverWidth, getHoverWidthAsString, getIcon, getIconBaseStyle, getIconHeight, getIconHSpace, getIconPageRect, getIconPrompt, getIconRect, getIcons, getIconTabPosition, getIconVAlign, getIconWidth, getID, getImageURLPrefix, getImageURLSuffix, getImplicitSave, getImplicitSaveOnBlur, getInputFormat, getLeft, getLinearColSpan, getLinearColSpanAsString, getLinearEndRow, getLinearEndRowAsString, getLinearStartRow, getLinearStartRowAsString, getLinearWidth, getLinearWidthAsString, getListGrid, getLoadingDisplayValue, getLocateItemBy, getMinHintWidth, getMultiple, getMultipleValueSeparator, getName, getNullOriginalValueText, getOperator, getOptionCriteria, getOptionDataSource, getOptionDataSourceAsString, getOptionFilterContext, getOptionOperationId, getOptionTextMatchStyle, getOriginalValueMessage, getPageLeft, getPageRect, getPageTop, getPaletteDefaults, getPicker, getPickerIcon, getPickerIcon, getPickerIconHeight, getPickerIconName, getPickerIconPrompt, getPickerIconProperties, getPickerIconSrc, getPickerIconStyle, getPickerIconTabPosition, getPickerIconWidth, getPixelHeight, getPixelWidth, getPrintReadOnlyTextBoxStyle, getPrintTextBoxStyle, getPrintTitleStyle, getPrompt, getReadOnlyCanSelectText, getReadOnlyControlStyle, getReadOnlyDisplay, getReadOnlyHover, getReadOnlyTextBoxStyle, getReadOnlyWhen, getRect, getRedrawOnChange, getRejectInvalidValueOnChange, getRequired, getRequiredMessage, getRequiredWhen, getRowSpan, getSaveOnEnter, getScClassName, getSelectedRecord, getSelectOnClick, getSelectOnFocus, getShouldSaveValue, getShowClippedTitleOnHover, getShowClippedValueOnHover, getShowDeletions, getShowDisabled, getShowDisabledIconsOnFocus, getShowDisabledPickerIconOnFocus, getShowErrorIcon, getShowErrorIconInline, getShowErrorStyle, getShowErrorText, getShowFocused, getShowFocusedErrorState, getShowFocusedIcons, getShowFocusedPickerIcon, getShowHint, getShowIcons, getShowIconsOnFocus, getShowImageAsURL, getShowOldValueInHover, getShowOver, getShowOverIcons, getShowPending, getShowPickerIcon, getShowPickerIconOnFocus, getShowRTL, getShowTitle, getShowValueIconOnly, getStartRow, getStaticHeight, getStopOnError, getStoreDisplayValues, getSupportsCutPasteEvents, getSuppressValueIcon, getSynchronousValidation, getTabIndex, getTextFormula, getTitle, getTitleAlign, getTitleColSpan, getTitleOrientation, getTitleStyle, getTitleVAlign, getTooltip, getTop, getType, getUpdateControlOnOver, getUpdatePickerIconOnOver, getUpdateTextBoxOnOver, getUseAdvancedCriteria, getUseDisabledHintStyleForReadOnly, getUseLocalDisplayFieldValue, getValidateOnChange, getValidateOnExit, getValidOperators, getVAlign, getValue, getValueAsFloat, getValueAsInteger, getValueAsLong, getValueAsRecordList, getValueDeselectedCSSText, getValueField, getValueFieldName, getValueIconHeight, getValueIconLeftPadding, getValueIconRightPadding, getValueIconSize, getValueIconWidth, getValueMap, getValueMapAsArray, getVisible, getVisibleHeight, getVisibleTitleWidth, getVisibleWhen, getVisibleWidth, getWarnOnEditorTypeConversion, getWarnOnEditorTypeConversionDefault, getWidth, getWidthAsString, getWrapStaticValue, getWrapTitle, handleWarnOnEditorTypeConversion, hasAdvancedCriteria, hasErrors, hide, hideIcon, invalidateDisplayValueCache, isAssignableFrom, isConfigOnly, isCreated, isCutEvent, isDisabled, isDrawn, isFocused, isInGrid, isPasteEvent, isVisible, linkToInstanceUponCreate, mapDisplayToValue, mapValueToDisplay, mapValueToDisplay, mapValueToDisplay, redraw, redraw, removeIcon, selectedRecordChanged, setAccessKey, setAlign, setAllowExpressions, setAlwaysFetchMissingValues, setAlwaysShowControlBox, setApplyAlignToText, setApplyHeightToTextBox, setAriaRole, setAriaState, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAutoChildConstructor, setAutoChildProperties, setAutoChildProperties, setAutoChildProperties, setAutoChildVisibility, setAutoComplete, setAutoCompleteKeywords, setBrowserSpellCheck, setCanEdit, setCanEditCriterionPredicate, setCanEditOpaqueValues, setCanFocus, setCanHover, setCanSelectText, setCanTabToIcons, setCellHeight, setCellStyle, setChangeOnKeypress, setClipStaticValue, setClipTitle, setColSpan, setColSpan, setConfigOnly, setControlStyle, setCriteriaField, setCriterion, setCriterionGetter, setCriterionSetter, setCustomStateGetter, setDataPath, setDateFormatter, setDecimalPad, setDecimalPrecision, setDefaultIconSrc, setDefaultOperator, setDefaultProperties, setDefaultValue, setDefaultValue, setDefaultValue, setDefaultValue, setDefaultValue, setDefaultValue, setDefaultValue, setDisabled, setDisabledHover, setDisableIconsOnReadOnly, setDisplayField, setDisplayFormat, setEditorProperties, setEditorType, setEditorType, setEditorType, setEditorValueFormatter, setEditorValueParser, setEditPendingCSSText, setEditProxyConstructor, setEmptyDisplayValue, setEmptyValueIcon, setEndRow, setErrorFormatter, setErrorIconHeight, setErrorIconProperties, setErrorIconSrc, setErrorIconWidth, setErrorMessageWidth, setErrorOrientation, setErrors, setErrors, setEscapeHTML, setExportFormat, setFetchMissingValues, setFilterLocally, setForeignDisplayField, setFormat, setFormula, setGlobalTabIndex, setHeight, setHeight, setHidden, setHint, setHintStyle, setHoverAlign, setHoverDelay, setHoverFocusKey, setHoverHeight, setHoverHeight, setHoverOpacity, setHoverPersist, setHoverStyle, setHoverVAlign, setHoverWidth, setHoverWidth, setIconBaseStyle, setIconDisabled, setIconHeight, setIconHSpace, setIconPrompt, setIcons, setIconShowOnFocus, setIconVAlign, setIconWidth, setID, setImageURLPrefix, setImageURLSuffix, setImplicitSave, setImplicitSaveOnBlur, setInitHandler, setInputFormat, setInputTransformer, setItemHoverFormatter, setItemTitleHoverFormatter, setItemValueHoverFormatter, setJavaScriptObject, setLeft, setLinearColSpan, setLinearColSpan, setLinearEndRow, setLinearEndRow, setLinearStartRow, setLinearStartRow, setLinearWidth, setLinearWidth, setLoadingDisplayValue, setLocateItemBy, setMinHintWidth, setMultiple, setMultipleValueSeparator, setName, setNullOriginalValueText, setNullProperty, setOperator, setOptionCriteria, setOptionDataSource, setOptionDataSource, setOptionFilterContext, setOptionOperationId, setOptionTextMatchStyle, setOriginalValueMessage, setPickerIconHeight, setPickerIconName, setPickerIconPrompt, setPickerIconProperties, setPickerIconSrc, setPickerIconStyle, setPickerIconWidth, setPrintReadOnlyTextBoxStyle, setPrintTextBoxStyle, setPrintTitleStyle, setPrompt, setProperty, setProperty, setProperty, setProperty, setProperty, setReadOnlyCanSelectText, setReadOnlyControlStyle, setReadOnlyDisplay, setReadOnlyHover, setReadOnlyTextBoxStyle, setReadOnlyWhen, setRedrawOnChange, setRejectInvalidValueOnChange, setRequired, setRequiredMessage, setRequiredWhen, setRowSpan, setSaveOnEnter, setScClassName, setSelectOnClick, setSelectOnFocus, setShouldSaveValue, setShowClippedTitleOnHover, setShowClippedValueOnHover, setShowDeletions, setShowDisabled, setShowDisabledIconsOnFocus, setShowDisabledPickerIconOnFocus, setShowErrorIcon, setShowErrorIconInline, setShowErrorStyle, setShowErrorText, setShowFocused, setShowFocusedErrorState, setShowFocusedIcons, setShowFocusedPickerIcon, setShowHint, setShowIcons, setShowIconsOnFocus, setShowIfCondition, setShowImageAsURL, setShowOldValueInHover, setShowOver, setShowOverIcons, setShowPending, setShowPickerIcon, setShowPickerIconOnFocus, setShowRTL, setShowTitle, setShowValueIconOnly, setStartRow, setStateCustomizer, setStaticHeight, setStopOnError, setStoreDisplayValues, setSupportsCutPasteEvents, setSuppressValueIcon, setSynchronousValidation, setTabIndex, setTextFormula, setTitle, setTitleAlign, setTitleColSpan, setTitleHoverFormatter, setTitleOrientation, setTitleStyle, setTitleVAlign, setTooltip, setTop, setType, setUpdateControlOnOver, setUpdatePickerIconOnOver, setUpdateTextBoxOnOver, setUseAdvancedCriteria, setUseDisabledHintStyleForReadOnly, setUseLocalDisplayFieldValue, setUseObjectFactoryForTypeFallback, setValidateOnChange, setValidateOnExit, setValidators, setValidOperators, setVAlign, setValue, setValue, setValue, setValue, setValue, setValue, setValueDeselectedCSSText, setValueField, setValueFormatter, setValueHoverFormatter, setValueIconHeight, setValueIconLeftPadding, setValueIconMapper, setValueIconRightPadding, setValueIcons, setValueIconSize, setValueIconWidth, setValueMap, setValueMap, setVisible, setVisibleWhen, setWarnOnEditorTypeConversion, setWarnOnEditorTypeConversionDefault, setWidth, setWidth, setWrapStaticValue, setWrapTitle, shouldApplyHeightToTextBox, shouldFetchMissingValue, shouldSaveOnEnter, shouldStopKeyPressBubbling, show, showIcon, showPicker, stopHover, storeValue, storeValue, updateState, validate, valueClipped
Methods inherited from class com.smartgwt.client.data.Field
getCanExport, getExportTitle, getSortByField, setCanExport, setExportTitle, setSortByField
Methods inherited from class com.smartgwt.client.core.RefDataClass
getRef, getRef, internalSetID
Methods inherited from class com.smartgwt.client.core.DataClass
applyFactoryProperties, doAddHandler, fireEvent, getAttributeAsDoubleArray, getAttributeAsElement, getAttributeAsIntArray, getAttributeAsLong, getAttributeAsMap, getAttributeAsObject, getAttributeAsRecord, getAttributeAsStringArray, getAttributes, getHandlerCount, isFactoryCreated, setAttribute, setAttribute, setAttribute, setAttributeAsJavaObject, setFactoryCreated
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.google.gwt.event.shared.HasHandlers
fireEvent
-
Constructor Details
-
TimeItem
public TimeItem() -
TimeItem
-
TimeItem
-
TimeItem
-
-
Method Details
-
getOrCreateRef
-
changeAutoChildDefaults
Changes the defaults for Canvas AutoChildren namedautoChildName
.- Parameters:
autoChildName
- name of an AutoChild to customize the defaults for.defaults
- Canvas defaults to apply. These defaults override any existing properties without destroying or wiping out non-overridden properties. For usage tips on this param, seeSGWTProperties
.- See Also:
-
changeAutoChildDefaults
Changes the defaults for FormItem AutoChildren namedautoChildName
.- Parameters:
autoChildName
- name of an AutoChild to customize the defaults for.defaults
- FormItem defaults to apply. These defaults override any existing properties without destroying or wiping out non-overridden properties. For usage tips on this param, seeSGWTProperties
.- See Also:
-
changePickerIconDefaults
-
getAmpmItem
Select item to hold the AM/PM value for the timeItem whenuseTextField
is false.This component is an AutoChild named "ampmItem". For an overview of how to use and configure AutoChildren, see
Using AutoChildren
.- Returns:
- Current ampmItem value. Default value is null
-
setAmpmItemProperties
Custom properties to apply to this timeItem's generatedAM/PM picker
.Note : This is an advanced setting
- Parameters:
ampmItemProperties
- New ampmItemProperties value. Default value is null- Returns:
TimeItem
instance, for chaining setter calls
-
getAmpmItemProperties
Custom properties to apply to this timeItem's generatedAM/PM picker
.- Returns:
- Current ampmItemProperties value. Default value is null
-
setAmpmItemTitle
Title to show for theAM/PM picker
.- Parameters:
ampmItemTitle
- New ampmItemTitle value. Default value is "AM/PM"- Returns:
TimeItem
instance, for chaining setter calls- See Also:
-
getAmpmItemTitle
Title to show for theAM/PM picker
.- Returns:
- Current ampmItemTitle value. Default value is "AM/PM"
- See Also:
-
setBrowserInputType
IfuseTextField
is true and browserInputType is set to "time", then a native HTML5 time input is used in place of a text input.The use of a native HTML5 time input causes certain features to be disabled. Input masks and a custom
timeFormatter
are not supported.In-field hints
are currently supported, but future browser changes might force this support to be removed. Therefore, it is safest to not use in-field hints (set showHintInField to false) in conjunction with a native HTML5 time input.NOTE: This feature requires specific CSS changes. Currently these changes have been made to the Enterprise, EnterpriseBlue, and Graphite skins only.
Note : This is an advanced setting
- Overrides:
setBrowserInputType
in classFormItem
- Parameters:
browserInputType
- New browserInputType value. Default value is null- Returns:
TimeItem
instance, for chaining setter calls
-
getBrowserInputType
IfuseTextField
is true and browserInputType is set to "time", then a native HTML5 time input is used in place of a text input.The use of a native HTML5 time input causes certain features to be disabled. Input masks and a custom
timeFormatter
are not supported.In-field hints
are currently supported, but future browser changes might force this support to be removed. Therefore, it is safest to not use in-field hints (set showHintInField to false) in conjunction with a native HTML5 time input.NOTE: This feature requires specific CSS changes. Currently these changes have been made to the Enterprise, EnterpriseBlue, and Graphite skins only.
- Overrides:
getBrowserInputType
in classFormItem
- Returns:
- Current browserInputType value. Default value is null
-
setHourIncrement
WhenuseTextField
is false andhourValues
is unset, this attribute specifies the increment to use when generating entries for the hour picker. For example, if this attribute is set to 5, the hour picker will contain only every fifth value between thehourMinValue
andhourMaxValue
.- Parameters:
hourIncrement
- New hourIncrement value. Default value is null- Returns:
TimeItem
instance, for chaining setter calls
-
getHourIncrement
WhenuseTextField
is false andhourValues
is unset, this attribute specifies the increment to use when generating entries for the hour picker. For example, if this attribute is set to 5, the hour picker will contain only every fifth value between thehourMinValue
andhourMaxValue
.- Returns:
- Current hourIncrement value. Default value is null
-
getHourItem
Select item to hold the hours portion of the time orduration
whenuseTextField
is false.This component is an AutoChild named "hourItem". For an overview of how to use and configure AutoChildren, see
Using AutoChildren
.- Returns:
- Current hourItem value. Default value is null
-
setHourItemPrompt
The hover prompt to show for thehour picker
.- Parameters:
hourItemPrompt
- New hourItemPrompt value. Default value is "Choose hours"- Returns:
TimeItem
instance, for chaining setter calls- See Also:
-
getHourItemPrompt
The hover prompt to show for thehour picker
.- Returns:
- Current hourItemPrompt value. Default value is "Choose hours"
- See Also:
-
setHourItemProperties
Custom properties to apply to this timeItem's generatedhour picker
.Note : This is an advanced setting
- Parameters:
hourItemProperties
- New hourItemProperties value. Default value is null- Returns:
TimeItem
instance, for chaining setter calls
-
getHourItemProperties
Custom properties to apply to this timeItem's generatedhour picker
.- Returns:
- Current hourItemProperties value. Default value is null
-
setHourItemTitle
Title to show for thehour picker
.- Parameters:
hourItemTitle
- New hourItemTitle value. Default value is "Hour"- Returns:
TimeItem
instance, for chaining setter calls- See Also:
-
getHourItemTitle
Title to show for thehour picker
.- Returns:
- Current hourItemTitle value. Default value is "Hour"
- See Also:
-
setHourMaxValue
WhenuseTextField
is false andhourValues
is unset, this attribute specifies the maximum value present in the hour picker.Used for specifying a limited set of valid Hour values, or when using the TimeItem to record duration, rather than time per-se. The default is 11 or 23, according to the value of
use24HourTime
andtimeFormatter
.See also
hourMinValue
andhourIncrement
.- Parameters:
hourMaxValue
- New hourMaxValue value. Default value is null- Returns:
TimeItem
instance, for chaining setter calls
-
getHourMaxValue
WhenuseTextField
is false andhourValues
is unset, this attribute specifies the maximum value present in the hour picker.Used for specifying a limited set of valid Hour values, or when using the TimeItem to record duration, rather than time per-se. The default is 11 or 23, according to the value of
use24HourTime
andtimeFormatter
.See also
hourMinValue
andhourIncrement
.- Returns:
- Current hourMaxValue value. Default value is null
-
setHourMinValue
WhenuseTextField
is false andhourValues
is unset, this attribute specifies the minimum value present in the hour picker.Used for specifying a limited set of valid Hour values, or when using the TimeItem to record duration, rather than time per-se. The default is zero in all cases.
See also
hourMaxValue
andhourIncrement
.- Parameters:
hourMinValue
- New hourMinValue value. Default value is null- Returns:
TimeItem
instance, for chaining setter calls
-
getHourMinValue
WhenuseTextField
is false andhourValues
is unset, this attribute specifies the minimum value present in the hour picker.Used for specifying a limited set of valid Hour values, or when using the TimeItem to record duration, rather than time per-se. The default is zero in all cases.
See also
hourMaxValue
andhourIncrement
.- Returns:
- Current hourMinValue value. Default value is null
-
setHourValues
An array of values to make available in thehour picker
whenuseTextField
is false.Used for specifying a limited set of valid Hour values, or when using the TimeItem to record duration, rather than time per-se.
See
hourMinValue
,hourMaxValue
andhourIncrement
for another method of controlling the content in the hour picker.
If this method is called after the component has been drawn/initialized: Sets the array of validhour values
to use whenuseTextField
is false.Used for limiting available valid Hour values, or when using the TimeItem to record duration, rather than time per-se.
See
hourMinValue
,hourMaxValue
andhourIncrement
for another method of controlling the content in the hour picker.- Parameters:
hourValues
- array of available Hour values. Default value is null- Returns:
TimeItem
instance, for chaining setter calls
-
getHourValues
public int[] getHourValues()An array of values to make available in thehour picker
whenuseTextField
is false.Used for specifying a limited set of valid Hour values, or when using the TimeItem to record duration, rather than time per-se.
See
hourMinValue
,hourMaxValue
andhourIncrement
for another method of controlling the content in the hour picker.- Returns:
- Returns an array of the current valid hour values, whether set directly as
hourValues
or generated according tohourMinValue
,hourMaxValue
andhourIncrement
. Default value is null
-
setInvalidTimeStringMessage
Validation error message to display if the user enters an invalid time string.- Parameters:
invalidTimeStringMessage
- New invalidTimeStringMessage value. Default value is "Invalid time"- Returns:
TimeItem
instance, for chaining setter calls- See Also:
-
getInvalidTimeStringMessage
Validation error message to display if the user enters an invalid time string.- Returns:
- Current invalidTimeStringMessage value. Default value is "Invalid time"
- See Also:
-
setItemTitleAlign
WhenuseTextField
is false, the default title-alignment of child-items such as thehour
,minute
andsecond
pickers, within their cells.- Parameters:
itemTitleAlign
- New itemTitleAlign value. Default value is "center"- Returns:
TimeItem
instance, for chaining setter calls- See Also:
-
getItemTitleAlign
WhenuseTextField
is false, the default title-alignment of child-items such as thehour
,minute
andsecond
pickers, within their cells.- Returns:
- Current itemTitleAlign value. Default value is "center"
- See Also:
-
setItemTitleOrientation
WhenuseTextField
is false, the default orientation of titles for child-items, such as thehour
,minute
andsecond
pickers.TitleOrientation
lists valid options.Note that titles on the left or right take up a cell in tabular
form layouts
, but titles on top do not.- Parameters:
itemTitleOrientation
- New itemTitleOrientation value. Default value is "top"- Returns:
TimeItem
instance, for chaining setter calls- See Also:
-
getItemTitleOrientation
WhenuseTextField
is false, the default orientation of titles for child-items, such as thehour
,minute
andsecond
pickers.TitleOrientation
lists valid options.Note that titles on the left or right take up a cell in tabular
form layouts
, but titles on top do not.- Returns:
- Current itemTitleOrientation value. Default value is "top"
- See Also:
-
setMillisecondIncrement
WhenuseTextField
is false andmillisecondValues
is unset, this attribute specifies the increment to use when generating entries for the millisecond picker. For example, if this attribute is set to 5, the millisecond picker will contain only every fifth value between themillisecondMinValue
andmillisecondMaxValue
.- Parameters:
millisecondIncrement
- New millisecondIncrement value. Default value is null- Returns:
TimeItem
instance, for chaining setter calls
-
getMillisecondIncrement
WhenuseTextField
is false andmillisecondValues
is unset, this attribute specifies the increment to use when generating entries for the millisecond picker. For example, if this attribute is set to 5, the millisecond picker will contain only every fifth value between themillisecondMinValue
andmillisecondMaxValue
.- Returns:
- Current millisecondIncrement value. Default value is null
-
getMillisecondItem
Select item to hold the milliseconds portion of the time orduration
whenuseTextField
is false.This component is an AutoChild named "millisecondItem". For an overview of how to use and configure AutoChildren, see
Using AutoChildren
.- Returns:
- Current millisecondItem value. Default value is null
-
setMillisecondItemPrompt
The hover prompt to show for themillisecond picker
.- Parameters:
millisecondItemPrompt
- New millisecondItemPrompt value. Default value is "Choose milliseconds"- Returns:
TimeItem
instance, for chaining setter calls- See Also:
-
getMillisecondItemPrompt
The hover prompt to show for themillisecond picker
.- Returns:
- Current millisecondItemPrompt value. Default value is "Choose milliseconds"
- See Also:
-
setMillisecondItemProperties
Custom properties to apply to this timeItem's generatedmillisecond picker
.Note : This is an advanced setting
- Parameters:
millisecondItemProperties
- New millisecondItemProperties value. Default value is null- Returns:
TimeItem
instance, for chaining setter calls
-
getMillisecondItemProperties
Custom properties to apply to this timeItem's generatedmillisecond picker
.- Returns:
- Current millisecondItemProperties value. Default value is null
-
setMillisecondItemTitle
Title to show for themillisecond picker
.- Parameters:
millisecondItemTitle
- New millisecondItemTitle value. Default value is "Ms"- Returns:
TimeItem
instance, for chaining setter calls- See Also:
-
getMillisecondItemTitle
Title to show for themillisecond picker
.- Returns:
- Current millisecondItemTitle value. Default value is "Ms"
- See Also:
-
setMillisecondMaxValue
WhenuseTextField
is false andmillisecondValues
is unset, this attribute specifies the maximum value present in the millisecond picker.Used for specifying a limited set of valid Millisecond values, or when using the TimeItem to record duration, rather than time per-se. The default is 999.
See also
millisecondMinValue
andmillisecondIncrement
.- Parameters:
millisecondMaxValue
- New millisecondMaxValue value. Default value is null- Returns:
TimeItem
instance, for chaining setter calls
-
getMillisecondMaxValue
WhenuseTextField
is false andmillisecondValues
is unset, this attribute specifies the maximum value present in the millisecond picker.Used for specifying a limited set of valid Millisecond values, or when using the TimeItem to record duration, rather than time per-se. The default is 999.
See also
millisecondMinValue
andmillisecondIncrement
.- Returns:
- Current millisecondMaxValue value. Default value is null
-
setMillisecondMinValue
WhenuseTextField
is false andmillisecondValues
is unset, this attribute specifies the minimum value present in the millisecond picker.Used for specifying a limited set of valid Millisecond values, or when using the TimeItem to record duration, rather than time per-se. The default is zero in all cases.
See also
millisecondMaxValue
andmillisecondIncrement
.- Parameters:
millisecondMinValue
- New millisecondMinValue value. Default value is null- Returns:
TimeItem
instance, for chaining setter calls
-
getMillisecondMinValue
WhenuseTextField
is false andmillisecondValues
is unset, this attribute specifies the minimum value present in the millisecond picker.Used for specifying a limited set of valid Millisecond values, or when using the TimeItem to record duration, rather than time per-se. The default is zero in all cases.
See also
millisecondMaxValue
andmillisecondIncrement
.- Returns:
- Current millisecondMinValue value. Default value is null
-
setMillisecondValues
An array of values to make available in themillisecond picker
whenuseTextField
is false.Used for specifying a limited set of valid Millisecond values, or when using the TimeItem to record duration, rather than time per-se.
See
millisecondMinValue
,millisecondMaxValue
andmillisecondIncrement
for another method of controlling the content in the millisecond picker.
If this method is called after the component has been drawn/initialized: Sets the array of validmillisecond values
to use whenuseTextField
is false.Used for limiting available valid Millisecond values, or when using the TimeItem to record duration, rather than time per-se.
See
millisecondMinValue
,millisecondMaxValue
andmillisecondIncrement
for another method of controlling the content in the millisecond picker.- Parameters:
millisecondValues
- array of available Millisecond values. Default value is null- Returns:
TimeItem
instance, for chaining setter calls
-
getMillisecondValues
public int[] getMillisecondValues()An array of values to make available in themillisecond picker
whenuseTextField
is false.Used for specifying a limited set of valid Millisecond values, or when using the TimeItem to record duration, rather than time per-se.
See
millisecondMinValue
,millisecondMaxValue
andmillisecondIncrement
for another method of controlling the content in the millisecond picker.- Returns:
- Returns an array of the current valid millisecond values, whether set directly as
millisecondValues
or generated according tomillisecondMinValue
,millisecondMaxValue
andmillisecondIncrement
. Default value is null
-
setMinuteIncrement
WhenuseTextField
is false andminuteValues
is unset, this attribute specifies the increment to use when generating entries for the minute picker. For example, if this attribute is set to 5, the minute picker will contain only every fifth value between theminuteMinValue
andminuteMaxValue
.- Parameters:
minuteIncrement
- New minuteIncrement value. Default value is null- Returns:
TimeItem
instance, for chaining setter calls
-
getMinuteIncrement
WhenuseTextField
is false andminuteValues
is unset, this attribute specifies the increment to use when generating entries for the minute picker. For example, if this attribute is set to 5, the minute picker will contain only every fifth value between theminuteMinValue
andminuteMaxValue
.- Returns:
- Current minuteIncrement value. Default value is null
-
getMinuteItem
Select item to hold the minutes portion of the time orduration
whenuseTextField
is false.This component is an AutoChild named "minuteItem". For an overview of how to use and configure AutoChildren, see
Using AutoChildren
.- Returns:
- Current minuteItem value. Default value is null
-
setMinuteItemPrompt
The hover prompt to show for theminute picker
.- Parameters:
minuteItemPrompt
- New minuteItemPrompt value. Default value is "Choose minutes"- Returns:
TimeItem
instance, for chaining setter calls- See Also:
-
getMinuteItemPrompt
The hover prompt to show for theminute picker
.- Returns:
- Current minuteItemPrompt value. Default value is "Choose minutes"
- See Also:
-
setMinuteItemProperties
Custom properties to apply to this timeItem's generatedminute picker
.Note : This is an advanced setting
- Parameters:
minuteItemProperties
- New minuteItemProperties value. Default value is null- Returns:
TimeItem
instance, for chaining setter calls
-
getMinuteItemProperties
Custom properties to apply to this timeItem's generatedminute picker
.- Returns:
- Current minuteItemProperties value. Default value is null
-
setMinuteItemTitle
Title to show for theminute picker
.- Parameters:
minuteItemTitle
- New minuteItemTitle value. Default value is "Min"- Returns:
TimeItem
instance, for chaining setter calls- See Also:
-
getMinuteItemTitle
Title to show for theminute picker
.- Returns:
- Current minuteItemTitle value. Default value is "Min"
- See Also:
-
setMinuteMaxValue
WhenuseTextField
is false andminuteValues
is unset, this attribute specifies the maximum value present in the minute picker.Used for specifying a limited set of valid Minute values, or when using the TimeItem to record duration, rather than time per-se. The default 59.
See also
minuteMinValue
andminuteIncrement
.- Parameters:
minuteMaxValue
- New minuteMaxValue value. Default value is null- Returns:
TimeItem
instance, for chaining setter calls
-
getMinuteMaxValue
WhenuseTextField
is false andminuteValues
is unset, this attribute specifies the maximum value present in the minute picker.Used for specifying a limited set of valid Minute values, or when using the TimeItem to record duration, rather than time per-se. The default 59.
See also
minuteMinValue
andminuteIncrement
.- Returns:
- Current minuteMaxValue value. Default value is null
-
setMinuteMinValue
WhenuseTextField
is false andminuteValues
is unset, this attribute specifies the minimum value present in the minute picker.Used for specifying a limited set of valid Minute values, or when using the TimeItem to record duration, rather than time per-se. The default is zero in all cases.
See also
minuteMaxValue
andminuteIncrement
.- Parameters:
minuteMinValue
- New minuteMinValue value. Default value is null- Returns:
TimeItem
instance, for chaining setter calls
-
getMinuteMinValue
WhenuseTextField
is false andminuteValues
is unset, this attribute specifies the minimum value present in the minute picker.Used for specifying a limited set of valid Minute values, or when using the TimeItem to record duration, rather than time per-se. The default is zero in all cases.
See also
minuteMaxValue
andminuteIncrement
.- Returns:
- Current minuteMinValue value. Default value is null
-
setMinuteValues
An array of values to make available in theminute picker
whenuseTextField
is false.Used for specifying a limited set of valid Minute values, or when using the TimeItem to record duration, rather than time per-se.
See
minuteMinValue
,minuteMaxValue
andminuteIncrement
for another method of controlling the content in the minute picker.
If this method is called after the component has been drawn/initialized: Sets the array of validminute values
to use whenuseTextField
is false.Used for limiting available valid Minute values, or when using the TimeItem to record duration, rather than time per-se.
See
minuteMinValue
,minuteMaxValue
andminuteIncrement
for another method of controlling the content in the minute picker.- Parameters:
minuteValues
- array of available Minute values. Default value is null- Returns:
TimeItem
instance, for chaining setter calls
-
getMinuteValues
public int[] getMinuteValues()An array of values to make available in theminute picker
whenuseTextField
is false.Used for specifying a limited set of valid Minute values, or when using the TimeItem to record duration, rather than time per-se.
See
minuteMinValue
,minuteMaxValue
andminuteIncrement
for another method of controlling the content in the minute picker.- Returns:
- Returns an array of the current valid minute values, whether set directly as
minuteValues
or generated according tominuteMinValue
,minuteMaxValue
andminuteIncrement
. Default value is null
-
setSecondIncrement
WhenuseTextField
is false andsecondValues
is unset, this attribute specifies the increment to use when generating entries for the second picker. For example, if this attribute is set to 5, the second picker will contain only every fifth value between thesecondMinValue
andsecondMaxValue
.- Parameters:
secondIncrement
- New secondIncrement value. Default value is null- Returns:
TimeItem
instance, for chaining setter calls
-
getSecondIncrement
WhenuseTextField
is false andsecondValues
is unset, this attribute specifies the increment to use when generating entries for the second picker. For example, if this attribute is set to 5, the second picker will contain only every fifth value between thesecondMinValue
andsecondMaxValue
.- Returns:
- Current secondIncrement value. Default value is null
-
getSecondItem
Select item to hold the seconds portion of the time orduration
whenuseTextField
is false.This component is an AutoChild named "secondItem". For an overview of how to use and configure AutoChildren, see
Using AutoChildren
.- Returns:
- Current secondItem value. Default value is null
-
setSecondItemPrompt
The hover prompt to show for thesecond picker
.- Parameters:
secondItemPrompt
- New secondItemPrompt value. Default value is "Choose seconds"- Returns:
TimeItem
instance, for chaining setter calls- See Also:
-
getSecondItemPrompt
The hover prompt to show for thesecond picker
.- Returns:
- Current secondItemPrompt value. Default value is "Choose seconds"
- See Also:
-
setSecondItemProperties
Custom properties to apply to this timeItem's generatedseconds picker
.Note : This is an advanced setting
- Parameters:
secondItemProperties
- New secondItemProperties value. Default value is null- Returns:
TimeItem
instance, for chaining setter calls
-
getSecondItemProperties
Custom properties to apply to this timeItem's generatedseconds picker
.- Returns:
- Current secondItemProperties value. Default value is null
-
setSecondItemTitle
Title to show for thesecond picker
.- Parameters:
secondItemTitle
- New secondItemTitle value. Default value is "Sec"- Returns:
TimeItem
instance, for chaining setter calls- See Also:
-
getSecondItemTitle
Title to show for thesecond picker
.- Returns:
- Current secondItemTitle value. Default value is "Sec"
- See Also:
-
setSecondMaxValue
WhenuseTextField
is false andsecondValues
is unset, this attribute specifies the maximum value present in the second picker.Used for specifying a limited set of valid Second values, or when using the TimeItem to record duration, rather than time per-se. The default is 59.
See also
secondMinValue
andsecondIncrement
.- Parameters:
secondMaxValue
- New secondMaxValue value. Default value is null- Returns:
TimeItem
instance, for chaining setter calls
-
getSecondMaxValue
WhenuseTextField
is false andsecondValues
is unset, this attribute specifies the maximum value present in the second picker.Used for specifying a limited set of valid Second values, or when using the TimeItem to record duration, rather than time per-se. The default is 59.
See also
secondMinValue
andsecondIncrement
.- Returns:
- Current secondMaxValue value. Default value is null
-
setSecondMinValue
WhenuseTextField
is false andsecondValues
is unset, this attribute specifies the minimum value present in the second picker.Used for specifying a limited set of valid Second values, or when using the TimeItem to record duration, rather than time per-se. The default is zero in all cases.
See also
secondMaxValue
andsecondIncrement
.- Parameters:
secondMinValue
- New secondMinValue value. Default value is null- Returns:
TimeItem
instance, for chaining setter calls
-
getSecondMinValue
WhenuseTextField
is false andsecondValues
is unset, this attribute specifies the minimum value present in the second picker.Used for specifying a limited set of valid Second values, or when using the TimeItem to record duration, rather than time per-se. The default is zero in all cases.
See also
secondMaxValue
andsecondIncrement
.- Returns:
- Current secondMinValue value. Default value is null
-
setSecondValues
An array of values to make available in thesecond picker
whenuseTextField
is false.Used for specifying a limited set of valid Second values, or when using the TimeItem to record duration, rather than time per-se.
See
secondMinValue
,secondMaxValue
andsecondIncrement
for another method of controlling the content in the second picker.
If this method is called after the component has been drawn/initialized: Sets the array of validsecond values
to use whenuseTextField
is false.Used for limiting available valid Second values, or when using the TimeItem to record duration, rather than time per-se.
See
secondMinValue
,secondMaxValue
andsecondIncrement
for another method of controlling the content in the second picker.- Parameters:
secondValues
- array of available Second values. Default value is null- Returns:
TimeItem
instance, for chaining setter calls
-
getSecondValues
public int[] getSecondValues()An array of values to make available in thesecond picker
whenuseTextField
is false.Used for specifying a limited set of valid Second values, or when using the TimeItem to record duration, rather than time per-se.
See
secondMinValue
,secondMaxValue
andsecondIncrement
for another method of controlling the content in the second picker.- Returns:
- Returns an array of the current valid second values, whether set directly as
secondValues
or generated according tosecondMinValue
,secondMaxValue
andsecondIncrement
. Default value is null
-
setShowHintInField
IfuseTextField
is true and ahint
is set, should the hint be shown within the field?Note that when using a native HTML5 time input (see
browserInputType
), in-field hints are currently supported, but future browser changes might not allow in-field hints to be supported. Therefore, it is safest to not use in-field hints in conjunction with a native HTML5 time input.To change this attribute after being drawn, it is necessary to call
FormItem.redraw()
or redraw the form.- Parameters:
showHintInField
- New showHintInField value. Default value is null- Returns:
TimeItem
instance, for chaining setter calls- See Also:
-
getShowHintInField
IfuseTextField
is true and ahint
is set, should the hint be shown within the field?Note that when using a native HTML5 time input (see
browserInputType
), in-field hints are currently supported, but future browser changes might not allow in-field hints to be supported. Therefore, it is safest to not use in-field hints in conjunction with a native HTML5 time input.To change this attribute after being drawn, it is necessary to call
FormItem.redraw()
or redraw the form.- Returns:
- Current showHintInField value. Default value is null
- See Also:
-
setShowHourItem
Controls whether to display thehourItem
whenuseTextField
is false.- Parameters:
showHourItem
- New showHourItem value. Default value is true- Returns:
TimeItem
instance, for chaining setter calls
-
getShowHourItem
Controls whether to display thehourItem
whenuseTextField
is false.- Returns:
- Current showHourItem value. Default value is true
-
setShowItemTitles
WhenuseTextField
is false, whether titles should be shown for for child-items in this TimeItem. By default,showItemTitles
is true, and titles are displayedabove the items
.- Parameters:
showItemTitles
- New showItemTitles value. Default value is true- Returns:
TimeItem
instance, for chaining setter calls- See Also:
-
getShowItemTitles
WhenuseTextField
is false, whether titles should be shown for for child-items in this TimeItem. By default,showItemTitles
is true, and titles are displayedabove the items
.- Returns:
- Current showItemTitles value. Default value is true
- See Also:
-
setShowMillisecondItem
Controls whether to display themillisecondItem
whenuseTextField
is false.- Parameters:
showMillisecondItem
- New showMillisecondItem value. Default value is false- Returns:
TimeItem
instance, for chaining setter calls
-
getShowMillisecondItem
Controls whether to display themillisecondItem
whenuseTextField
is false.- Returns:
- Current showMillisecondItem value. Default value is false
-
setShowMinuteItem
Controls whether to display theminuteItem
whenuseTextField
is false.- Parameters:
showMinuteItem
- New showMinuteItem value. Default value is true- Returns:
TimeItem
instance, for chaining setter calls
-
getShowMinuteItem
Controls whether to display theminuteItem
whenuseTextField
is false.- Returns:
- Current showMinuteItem value. Default value is true
-
setShowSecondItem
Controls whether to display thesecondItem
whenuseTextField
is false.- Parameters:
showSecondItem
- New showSecondItem value. Default value is true- Returns:
TimeItem
instance, for chaining setter calls
-
getShowSecondItem
Controls whether to display thesecondItem
whenuseTextField
is false.- Returns:
- Current showSecondItem value. Default value is true
-
setTextAlign
IfuseTextField
istrue
, this property governs the alignment of text within the text field. Defaults to"left"
by default or"right"
if the page is inrtl mode
.This attribute does not have an effect if a native HTML5 time input is being used. See
browserInputType
.- Overrides:
setTextAlign
in classFormItem
- Parameters:
textAlign
- New textAlign value. Default value is varies- Returns:
TimeItem
instance, for chaining setter calls- See Also:
-
getTextAlign
IfuseTextField
istrue
, this property governs the alignment of text within the text field. Defaults to"left"
by default or"right"
if the page is inrtl mode
.This attribute does not have an effect if a native HTML5 time input is being used. See
browserInputType
.- Overrides:
getTextAlign
in classFormItem
- Returns:
- Current textAlign value. Default value is varies
- See Also:
-
setTextBoxStyle
Base CSS class for this item's text box. If specified this style will be applied to thetextField
ifuseTextField
is set totrue
.- Overrides:
setTextBoxStyle
in classFormItem
- Parameters:
textBoxStyle
- New textBoxStyle value. Default value is null- Returns:
TimeItem
instance, for chaining setter calls- See Also:
-
getTextBoxStyle
Base CSS class for this item's text box. If specified this style will be applied to thetextField
ifuseTextField
is set totrue
.- Overrides:
getTextBoxStyle
in classFormItem
- Returns:
- Current textBoxStyle value. Default value is null
- See Also:
-
getTextField
Text field to hold the entire time in "type in" format, ifuseTextField
is true.This component is an AutoChild named "textField". For an overview of how to use and configure AutoChildren, see
Using AutoChildren
.- Returns:
- Current textField value. Default value is null
-
setTextFieldProperties
Custom properties to apply to thetext field
generated for this timeItem whenuseTextField
is true.Note : This is an advanced setting
- Parameters:
textFieldProperties
- New textFieldProperties value. Default value is null- Returns:
TimeItem
instance, for chaining setter calls
-
getTextFieldProperties
Custom properties to apply to thetext field
generated for this timeItem whenuseTextField
is true.- Returns:
- Current textFieldProperties value. Default value is null
-
setTimeFormatter
IfuseTextField
is true, what format should this item's time string be presented in?If unset, the default formatter will be
timeFormatter24Hour
ortimeFormatter12Hour
depending on the value ofuse24HourTime
. If the property cannot be derived in this way (none of these properties are set), we'll checkDynamicForm.timeFormatter
, or finally back off to the standard system-wide String will be applied.This attribute does not have an effect if a native HTML5 time input is being used. See
browserInputType
.- Overrides:
setTimeFormatter
in classFormItem
- Parameters:
timeFormatter
- New timeFormatter value. Default value is null- Returns:
TimeItem
instance, for chaining setter calls- See Also:
-
getTimeFormatter
IfuseTextField
is true, what format should this item's time string be presented in?If unset, the default formatter will be
timeFormatter24Hour
ortimeFormatter12Hour
depending on the value ofuse24HourTime
. If the property cannot be derived in this way (none of these properties are set), we'll checkDynamicForm.timeFormatter
, or finally back off to the standard system-wide String will be applied.This attribute does not have an effect if a native HTML5 time input is being used. See
browserInputType
.- Overrides:
getTimeFormatter
in classFormItem
- Returns:
- Current timeFormatter value. Default value is null
- See Also:
-
setTimeFormatter12Hour
IfuseTextField
is true, anduse24HourTime
is false, what format should this item's time string be presented in?May be overridden via an explicitly specified
timeFormatter
.This attribute does not have an effect if a native HTML5 time input is being used. See
browserInputType
.- Parameters:
timeFormatter12Hour
- New timeFormatter12Hour value. Default value is "toShortTime"- Returns:
TimeItem
instance, for chaining setter calls
-
getTimeFormatter12Hour
IfuseTextField
is true, anduse24HourTime
is false, what format should this item's time string be presented in?May be overridden via an explicitly specified
timeFormatter
.This attribute does not have an effect if a native HTML5 time input is being used. See
browserInputType
.- Returns:
- Current timeFormatter12Hour value. Default value is "toShortTime"
-
setTimeFormatter24Hour
IfuseTextField
is true, anduse24HourTime
is true, what format should this item's time string be presented in?May be overridden via an explicitly specified
timeFormatter
.This attribute does not have an effect if a native HTML5 time input is being used. See
browserInputType
.- Parameters:
timeFormatter24Hour
- New timeFormatter24Hour value. Default value is "toShort24HourTime"- Returns:
TimeItem
instance, for chaining setter calls
-
getTimeFormatter24Hour
IfuseTextField
is true, anduse24HourTime
is true, what format should this item's time string be presented in?May be overridden via an explicitly specified
timeFormatter
.This attribute does not have an effect if a native HTML5 time input is being used. See
browserInputType
.- Returns:
- Current timeFormatter24Hour value. Default value is "toShort24HourTime"
-
setUse24HourTime
Whether to enforce 24-hour time in the UI. If unset, assumes to the String.- Parameters:
use24HourTime
- New use24HourTime value. Default value is null- Returns:
TimeItem
instance, for chaining setter calls
-
getUse24HourTime
Whether to enforce 24-hour time in the UI. If unset, assumes to the String.- Returns:
- Current use24HourTime value. Default value is null
-
setUseMask
If true, a data entry mask will be enabled in the field based on thetimeFormatter
.Note that if a non-padded
timeFormatter
is specified, it will be changed to the corresponding padded version (ex. "toShort24HourTime" will be changed to "toShortPadded24HourTime").This attribute does not have an effect if a native HTML5 time input is being used. See
browserInputType
.Note : This is an advanced setting
- Parameters:
useMask
- New useMask value. Default value is null- Returns:
TimeItem
instance, for chaining setter calls
-
getUseMask
If true, a data entry mask will be enabled in the field based on thetimeFormatter
.Note that if a non-padded
timeFormatter
is specified, it will be changed to the corresponding padded version (ex. "toShort24HourTime" will be changed to "toShortPadded24HourTime").This attribute does not have an effect if a native HTML5 time input is being used. See
browserInputType
.- Returns:
- Current useMask value. Default value is null
-
setUsePlaceholderForHint
Ifshowing the hint in field
and if supported by the browser, should the HTML5placeholder
attribute be used to display the hint within the field? If set tofalse
, then use of theplaceholder
attribute is disabled and an alternative technique to display the hint in-field is used instead.The HTML5
placeholder
attribute is supported in the following major browsers:- Chrome 4+
- Firefox 4+
- Internet Explorer 10+
- Safari 5+
- Opera 11.50+
- Android 2.1+
WebView
(used by the stock Browser app and whenpackaging with PhoneGap
) - Mobile Safari for iOS 3.2+
In browsers other than the above, in-field hints are implemented via a different technique.
Note that placeholder behavior is known to differ in Internet Explorer and certain old versions of the above browsers due to a recent change in the HTML5 specification regarding the
placeholder
attribute. Under the old rules, the placeholder is cleared when the element is focused. In the latest HTML5 spec as published by WHATWG, the placeholder is still displayed when the element is focused as long as the value is an empty string.Styling the placeholder
While there isn't a standard way to style the placeholder text, Chrome, Firefox, Internet Explorer, and Safari provide vendor-prefixed pseudo-classes and/or pseudo-elements that can be used in CSS selectors:Browser Pseudo-class or pseudo-element Chrome, Safari ::-webkit-input-placeholder
Firefox 4 - 18 :-moz-placeholder
Firefox 19+ ::-moz-placeholder
Internet Explorer :-ms-input-placeholder
Note that unlike other browsers, Firefox 19+ applies opacity:0.4 to the placeholder text. See Bug 556145 - Placeholder text default style should use opacity instead of GrayText
Because browsers are required to ignore the entire rule if a selector is invalid, separate rules are needed for each browser. For example:
::-webkit-input-placeholder { color: blue; opacity: 1; } :-moz-placeholder { color: blue; opacity: 1; } ::-moz-placeholder { color: blue; opacity: 1; } :-ms-input-placeholder { color: blue; opacity: 1; }
If using Sass, it may be useful to utilize Sass' parent selector feature. For example:
.myCustomItem, .myCustomItemRTL, .myCustomItemDisabled, .myCustomItemDisabledRTL, .myCustomItemError, .myCustomItemErrorRTL, .myCustomItemFocused, .myCustomItemFocusedRTL, .myCustomItemHint, .myCustomItemHintRTL, .myCustomItemDisabledHint, .myCustomItemDisabledHintRTL { // ... &::-webkit-input-placeholder { color: blue; opacity: 1; } &:-moz-placeholder { color: blue; opacity: 1; } &::-moz-placeholder { color: blue; opacity: 1; } &:-ms-input-placeholder { color: blue; opacity: 1; } }
If using Compass, the
input-placeholder
mixin that was added in version 1.0 can further simplify the code to style the placeholder text For example:.myCustomItem, .myCustomItemRTL, .myCustomItemDisabled, .myCustomItemDisabledRTL, .myCustomItemError, .myCustomItemErrorRTL, .myCustomItemFocused, .myCustomItemFocusedRTL, .myCustomItemHint, .myCustomItemHintRTL, .myCustomItemDisabledHint, .myCustomItemDisabledHintRTL { // ... @include input-placeholder { color: blue; opacity: 1; } }
Accessibility concerns
The HTML5 specification notes that a placeholder should not be used as a replacement for a title. The placeholder is intended to be a short hint that assists the user who is entering a value into the empty field. The placeholder can be mistaken by some users for a pre-filled value, particularly in Internet Explorer because the same color is used, and the placeholder text color may provide insufficient contrast, particularly in Firefox 19+ because of the default 0.4 opacity. Furthermore, not having a title reduces the hit area available for setting focus on the item.Note : This is an advanced setting
- Parameters:
usePlaceholderForHint
- New usePlaceholderForHint value. Default value is true- Returns:
TimeItem
instance, for chaining setter calls- See Also:
-
getUsePlaceholderForHint
public boolean getUsePlaceholderForHint()Ifshowing the hint in field
and if supported by the browser, should the HTML5placeholder
attribute be used to display the hint within the field? If set tofalse
, then use of theplaceholder
attribute is disabled and an alternative technique to display the hint in-field is used instead.The HTML5
placeholder
attribute is supported in the following major browsers:- Chrome 4+
- Firefox 4+
- Internet Explorer 10+
- Safari 5+
- Opera 11.50+
- Android 2.1+
WebView
(used by the stock Browser app and whenpackaging with PhoneGap
) - Mobile Safari for iOS 3.2+
In browsers other than the above, in-field hints are implemented via a different technique.
Note that placeholder behavior is known to differ in Internet Explorer and certain old versions of the above browsers due to a recent change in the HTML5 specification regarding the
placeholder
attribute. Under the old rules, the placeholder is cleared when the element is focused. In the latest HTML5 spec as published by WHATWG, the placeholder is still displayed when the element is focused as long as the value is an empty string.Styling the placeholder
While there isn't a standard way to style the placeholder text, Chrome, Firefox, Internet Explorer, and Safari provide vendor-prefixed pseudo-classes and/or pseudo-elements that can be used in CSS selectors:Browser Pseudo-class or pseudo-element Chrome, Safari ::-webkit-input-placeholder
Firefox 4 - 18 :-moz-placeholder
Firefox 19+ ::-moz-placeholder
Internet Explorer :-ms-input-placeholder
Note that unlike other browsers, Firefox 19+ applies opacity:0.4 to the placeholder text. See Bug 556145 - Placeholder text default style should use opacity instead of GrayText
Because browsers are required to ignore the entire rule if a selector is invalid, separate rules are needed for each browser. For example:
::-webkit-input-placeholder { color: blue; opacity: 1; } :-moz-placeholder { color: blue; opacity: 1; } ::-moz-placeholder { color: blue; opacity: 1; } :-ms-input-placeholder { color: blue; opacity: 1; }
If using Sass, it may be useful to utilize Sass' parent selector feature. For example:
.myCustomItem, .myCustomItemRTL, .myCustomItemDisabled, .myCustomItemDisabledRTL, .myCustomItemError, .myCustomItemErrorRTL, .myCustomItemFocused, .myCustomItemFocusedRTL, .myCustomItemHint, .myCustomItemHintRTL, .myCustomItemDisabledHint, .myCustomItemDisabledHintRTL { // ... &::-webkit-input-placeholder { color: blue; opacity: 1; } &:-moz-placeholder { color: blue; opacity: 1; } &::-moz-placeholder { color: blue; opacity: 1; } &:-ms-input-placeholder { color: blue; opacity: 1; } }
If using Compass, the
input-placeholder
mixin that was added in version 1.0 can further simplify the code to style the placeholder text For example:.myCustomItem, .myCustomItemRTL, .myCustomItemDisabled, .myCustomItemDisabledRTL, .myCustomItemError, .myCustomItemErrorRTL, .myCustomItemFocused, .myCustomItemFocusedRTL, .myCustomItemHint, .myCustomItemHintRTL, .myCustomItemDisabledHint, .myCustomItemDisabledHintRTL { // ... @include input-placeholder { color: blue; opacity: 1; } }
Accessibility concerns
The HTML5 specification notes that a placeholder should not be used as a replacement for a title. The placeholder is intended to be a short hint that assists the user who is entering a value into the empty field. The placeholder can be mistaken by some users for a pre-filled value, particularly in Internet Explorer because the same color is used, and the placeholder text color may provide insufficient contrast, particularly in Firefox 19+ because of the default 0.4 opacity. Furthermore, not having a title reduces the hit area available for setting focus on the item.- Returns:
- Current usePlaceholderForHint value. Default value is true
- See Also:
-
setUseTextField
Should we show the time in a text field, or as a number of SelectItems?- Parameters:
useTextField
- New useTextField value. Default value is true- Returns:
TimeItem
instance, for chaining setter calls
-
getUseTextField
Should we show the time in a text field, or as a number of SelectItems?- Returns:
- Current useTextField value. Default value is true
-
setWrapHintText
If this item is showing aFormItem.hint
, should the hint text be allowed to wrap? Setting this property tofalse
will render the hint on a single line without wrapping, expanding the width required to render the item if necessary.If unset this property will be picked up from the
DynamicForm.wrapHintText
setting.This setting does not apply to hints that are
shown in field
.- Overrides:
setWrapHintText
in classFormItem
- Parameters:
wrapHintText
- New wrapHintText value. Default value is false- Returns:
TimeItem
instance, for chaining setter calls- See Also:
-
getWrapHintText
If this item is showing aFormItem.hint
, should the hint text be allowed to wrap? Setting this property tofalse
will render the hint on a single line without wrapping, expanding the width required to render the item if necessary.If unset this property will be picked up from the
DynamicForm.wrapHintText
setting.This setting does not apply to hints that are
shown in field
.- Overrides:
getWrapHintText
in classFormItem
- Returns:
- Current wrapHintText value. Default value is false
- See Also:
-
deselectValue
public void deselectValue()IfuseTextField
is true, falls through to standarddeselectValue()
implementation on this items freeform text entry field. Otherwise has no effect. -
deselectValue
IfuseTextField
is true, falls through to standarddeselectValue()
implementation on this items freeform text entry field. Otherwise has no effect.- Parameters:
start
- If this parameter is passed, new cursor insertion position will be moved to the start, rather than the end of this item's value.
-
getDuration
public int getDuration()WhenuseTextField
is set to false, this method returns the value of the time expressed as a duration in thetimeUnit
provided. If no timeUnit is passed, the default is the smallest unit for which a picker is visible.- Returns:
- the item's value, expressed as a duration in the TimeUnit passed
-
getDuration
WhenuseTextField
is set to false, this method returns the value of the time expressed as a duration in thetimeUnit
provided. If no timeUnit is passed, the default is the smallest unit for which a picker is visible.- Parameters:
timeUnit
- the unit of the return value- Returns:
- the item's value, expressed as a duration in the TimeUnit passed
-
getEnteredValue
Returns the raw text value typed into this items text field ifuseTextField
is true (otherwise returns the result of this.getValue()).- Returns:
- value the user entered
-
pendingStatusChanged
public boolean pendingStatusChanged(DynamicForm form, FormItem item, boolean pendingStatus, Object newValue, Object value) Notification method called whenshowPending
is enabled and this time item should either clear or show its pending visual state.The default behavior is that the
titleStyle
andcellStyle
are updated to include/exclude the "Pending" suffix. In addition, when displayed in the pending state:- If
useTextField
istrue
, then the "Pending" suffix will be appended to thetextBoxStyle
applied to thetextField
; otherwise - (
useTextField
isfalse
) the color of thehourItem
,minuteItem
,secondItem
,millisecondItem
, and/orampmItem
will change when the hour, minute, second, millisecond, or whether the time is AM or PM is different, respectively.
false
will cancel this default behavior.- Parameters:
form
- the managingDynamicForm
instance.item
- the form item itself (also available as "this").pendingStatus
-true
if the item should show its pending visual state;false
otherwise.newValue
- the current form item value.value
- the value that would be restored by a call toDynamicForm.resetValues()
.- Returns:
false
to cancel the default behavior.
- If
-
selectValue
public void selectValue()IfuseTextField
is true, falls through to standardselectValue()
implementation on this items freeform text entry field. Otherwise has no effect. -
setHours
public void setHours(int hours) Set the hour value of this TimeItem. If the item value has not been initialized withsetValue()
, the minute will be established to current minute.You can use
setValue()
to set both hours and minutes at the same time.setHours() cannot be called until the item has been added to a DynamicForm and the form has been drawn.
- Parameters:
hours
- new hours value for this TimeItem.
-
setMilliseconds
public void setMilliseconds(int milliseconds) Set the milliseconds value of this TimeItem.- Parameters:
milliseconds
- new milliseconds value for this TimeItem.
-
setMinutes
public void setMinutes(int minutes) Set the minute value of this TimeItem. If the item value has not been initialized withsetValue()
, the hour will be established to current hour.You can use
setValue()
to set both hours and minutes at the same time.setMinutes() cannot be called until the item has been added to a DynamicForm and the form has been drawn.
- Parameters:
minutes
- new minutes value for this TimeItem.
-
setSeconds
public void setSeconds(int seconds) Set the seconds value of this TimeItem.- Parameters:
seconds
- new seconds value for this TimeItem.
-
setSelectionRange
public void setSelectionRange(int start, int end) IfuseTextField
is true, falls through to standardsetSelectionRange
implementation on this items freeform text entry field. Otherwise has no effect.- Parameters:
start
- character index for start of new selectionend
- character index for end of new selection
-
setDefaultProperties
Class level method to set the default properties of this class. If set, then all existing and subsequently created instances of this class will automatically have default properties corresponding to the properties of the class instance passed to this function. This is a powerful feature that eliminates the need for users to create a separate hierarchy of subclasses that only alter the default properties of this class. Can also be used for skinning / styling purposes.Note: This method is intended for setting default attributes only and will affect all instances of the underlying class (including those automatically generated in JavaScript). This method should not be used to apply standard EventHandlers or override methods for a class - use a custom subclass instead. Calling this method after instances have been created can result in undefined behavior, since it bypasses any setters and a class instance may have already examined a particular property and not be expecting any changes through this route.
- Parameters:
timeItemProperties
- properties that should be used as new defaults when instances of this class are created- See Also:
-
getValueAsDate
Return the value tracked by this form item.- Returns:
- value of this element
-
setDisplayFormat
Deprecated.UsesetDisplayFormat(TimeDisplayFormat)
instead.What format should this item's time string be presented in?- Overrides:
setDisplayFormat
in classFormItem
- Parameters:
timeFormatter
- displayFormat Default value is "toShort24HourTime"- See Also:
-
setDisplayFormat
Deprecated.UsegetTimeFormatter()
instead.What format should this item's time string be presented in?- Parameters:
TimeDisplayFormat
- displayFormat Default value is "toShort24HourTime"
-
getDisplayFormat
Deprecated.What format should this item's time string be presented in?- Returns:
- TimeDisplayFormat
-
getSelectionRange
public int[] getSelectionRange()IfuseTextField
is true, falls through to standardcom.smartgwt.client.widgets.form.fields.FormItem#getSelectionRange
implementation on this item's freeform text entry field. Otherwise has no effect.- Returns:
- 2 element array indicating start/end character index of current selection within our text entry field. Returns null if this item is undrawn or doesn't have focus.
-
setTimeFormatter(com.smartgwt.client.types.TimeDisplayFormat)
instead.