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, warnOnEditorTypeConversionDefaultFields inherited from class com.smartgwt.client.core.RefDataClass
idFields inherited from class com.smartgwt.client.core.DataClass
factoryCreated, factoryProperties -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidchangeAutoChildDefaults(String autoChildName, Canvas defaults) Changes the defaults for Canvas AutoChildren namedautoChildName.static voidchangeAutoChildDefaults(String autoChildName, FormItem defaults) Changes the defaults for FormItem AutoChildren namedautoChildName.static voidchangePickerIconDefaults(FormItemIcon defaults) voidIfuseTextFieldis true, falls through to standarddeselectValue()implementation on this items freeform text entry field.voiddeselectValue(Boolean start) IfuseTextFieldis true, falls through to standarddeselectValue()implementation on this items freeform text entry field.Select item to hold the AM/PM value for the timeItem whenuseTextFieldis false.Custom properties to apply to this timeItem's generatedAM/PM picker.Title to show for theAM/PM picker.IfuseTextFieldis true and browserInputType is set to "time", then a native HTML5 time input is used in place of a text input.Deprecated.intWhenuseTextFieldis set to false, this method returns the value of the time expressed as a duration in thetimeUnitprovided.intgetDuration(TimeUnit timeUnit) WhenuseTextFieldis set to false, this method returns the value of the time expressed as a duration in thetimeUnitprovided.Returns the raw text value typed into this items text field ifuseTextFieldis true (otherwise returns the result of this.getValue()).WhenuseTextFieldis false andhourValuesis 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 ordurationwhenuseTextFieldis 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.WhenuseTextFieldis false andhourValuesis unset, this attribute specifies the maximum value present in the hour picker.WhenuseTextFieldis false andhourValuesis unset, this attribute specifies the minimum value present in the hour picker.int[]An array of values to make available in thehour pickerwhenuseTextFieldis false.Validation error message to display if the user enters an invalid time string.WhenuseTextFieldis false, the default title-alignment of child-items such as thehour,minuteandsecondpickers, within their cells.WhenuseTextFieldis false, the default orientation of titles for child-items, such as thehour,minuteandsecondpickers.WhenuseTextFieldis false andmillisecondValuesis 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 ordurationwhenuseTextFieldis 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.WhenuseTextFieldis false andmillisecondValuesis unset, this attribute specifies the maximum value present in the millisecond picker.WhenuseTextFieldis false andmillisecondValuesis unset, this attribute specifies the minimum value present in the millisecond picker.int[]An array of values to make available in themillisecond pickerwhenuseTextFieldis false.WhenuseTextFieldis false andminuteValuesis 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 ordurationwhenuseTextFieldis 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.WhenuseTextFieldis false andminuteValuesis unset, this attribute specifies the maximum value present in the minute picker.WhenuseTextFieldis false andminuteValuesis unset, this attribute specifies the minimum value present in the minute picker.int[]An array of values to make available in theminute pickerwhenuseTextFieldis false.static TimeItemgetOrCreateRef(JavaScriptObject jsObj) WhenuseTextFieldis false andsecondValuesis 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 ordurationwhenuseTextFieldis 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.WhenuseTextFieldis false andsecondValuesis unset, this attribute specifies the maximum value present in the second picker.WhenuseTextFieldis false andsecondValuesis unset, this attribute specifies the minimum value present in the second picker.int[]An array of values to make available in thesecond pickerwhenuseTextFieldis false.int[]IfuseTextFieldis true, falls through to standardcom.smartgwt.client.widgets.form.fields.FormItem#getSelectionRangeimplementation on this item's freeform text entry field.IfuseTextFieldis true and ahintis set, should the hint be shown within the field?Controls whether to display thehourItemwhenuseTextFieldis false.WhenuseTextFieldis false, whether titles should be shown for for child-items in this TimeItem.Controls whether to display themillisecondItemwhenuseTextFieldis false.Controls whether to display theminuteItemwhenuseTextFieldis false.Controls whether to display thesecondItemwhenuseTextFieldis false.IfuseTextFieldistrue, 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, ifuseTextFieldis true.Custom properties to apply to thetext fieldgenerated for this timeItem whenuseTextFieldis true.IfuseTextFieldis true, what format should this item's time string be presented in?IfuseTextFieldis true, anduse24HourTimeis false, what format should this item's time string be presented in?IfuseTextFieldis true, anduse24HourTimeis 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.booleanIfshowing the hint in fieldand if supported by the browser, should the HTML5placeholderattribute be used to display the hint within the field? If set tofalse, then use of theplaceholderattribute 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 tofalsewill render the hint on a single line without wrapping, expanding the width required to render the item if necessary.booleanpendingStatusChanged(DynamicForm form, FormItem item, boolean pendingStatus, Object newValue, Object value) Notification method called whenshowPendingis enabled and this time item should either clear or show its pending visual state.voidIfuseTextFieldis 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) IfuseTextFieldis true and browserInputType is set to "time", then a native HTML5 time input is used in place of a text input.static voidsetDefaultProperties(TimeItem timeItemProperties) Class level method to set the default properties of this class.voidsetDisplayFormat(TimeDisplayFormat timeFormatter) Deprecated.UsegetTimeFormatter()instead.voidsetDisplayFormat(TimeFormatter timeFormatter) Deprecated.UsesetDisplayFormat(TimeDisplayFormat)instead.setHourIncrement(Integer hourIncrement) WhenuseTextFieldis false andhourValuesis 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) WhenuseTextFieldis false andhourValuesis unset, this attribute specifies the maximum value present in the hour picker.setHourMinValue(Integer hourMinValue) WhenuseTextFieldis false andhourValuesis unset, this attribute specifies the minimum value present in the hour picker.voidsetHours(int hours) Set the hour value of this TimeItem.setHourValues(int... hourValues) An array of values to make available in thehour pickerwhenuseTextFieldis false.setInvalidTimeStringMessage(String invalidTimeStringMessage) Validation error message to display if the user enters an invalid time string.setItemTitleAlign(Alignment itemTitleAlign) WhenuseTextFieldis false, the default title-alignment of child-items such as thehour,minuteandsecondpickers, within their cells.setItemTitleOrientation(TitleOrientation itemTitleOrientation) WhenuseTextFieldis false, the default orientation of titles for child-items, such as thehour,minuteandsecondpickers.setMillisecondIncrement(Integer millisecondIncrement) WhenuseTextFieldis false andmillisecondValuesis 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) WhenuseTextFieldis false andmillisecondValuesis unset, this attribute specifies the maximum value present in the millisecond picker.setMillisecondMinValue(Integer millisecondMinValue) WhenuseTextFieldis false andmillisecondValuesis unset, this attribute specifies the minimum value present in the millisecond picker.voidsetMilliseconds(int milliseconds) Set the milliseconds value of this TimeItem.setMillisecondValues(int... millisecondValues) An array of values to make available in themillisecond pickerwhenuseTextFieldis false.setMinuteIncrement(Integer minuteIncrement) WhenuseTextFieldis false andminuteValuesis 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) WhenuseTextFieldis false andminuteValuesis unset, this attribute specifies the maximum value present in the minute picker.setMinuteMinValue(Integer minuteMinValue) WhenuseTextFieldis false andminuteValuesis unset, this attribute specifies the minimum value present in the minute picker.voidsetMinutes(int minutes) Set the minute value of this TimeItem.setMinuteValues(int... minuteValues) An array of values to make available in theminute pickerwhenuseTextFieldis false.setSecondIncrement(Integer secondIncrement) WhenuseTextFieldis false andsecondValuesis 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) WhenuseTextFieldis false andsecondValuesis unset, this attribute specifies the maximum value present in the second picker.setSecondMinValue(Integer secondMinValue) WhenuseTextFieldis false andsecondValuesis unset, this attribute specifies the minimum value present in the second picker.voidsetSeconds(int seconds) Set the seconds value of this TimeItem.setSecondValues(int... secondValues) An array of values to make available in thesecond pickerwhenuseTextFieldis false.voidsetSelectionRange(int start, int end) IfuseTextFieldis true, falls through to standardsetSelectionRangeimplementation on this items freeform text entry field.setShowHintInField(Boolean showHintInField) IfuseTextFieldis true and ahintis set, should the hint be shown within the field?setShowHourItem(Boolean showHourItem) Controls whether to display thehourItemwhenuseTextFieldis false.setShowItemTitles(Boolean showItemTitles) WhenuseTextFieldis false, whether titles should be shown for for child-items in this TimeItem.setShowMillisecondItem(Boolean showMillisecondItem) Controls whether to display themillisecondItemwhenuseTextFieldis false.setShowMinuteItem(Boolean showMinuteItem) Controls whether to display theminuteItemwhenuseTextFieldis false.setShowSecondItem(Boolean showSecondItem) Controls whether to display thesecondItemwhenuseTextFieldis false.setTextAlign(Alignment textAlign) IfuseTextFieldistrue, 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 fieldgenerated for this timeItem whenuseTextFieldis true.setTimeFormatter(TimeDisplayFormat timeFormatter) IfuseTextFieldis true, what format should this item's time string be presented in?setTimeFormatter12Hour(TimeDisplayFormat timeFormatter12Hour) IfuseTextFieldis true, anduse24HourTimeis false, what format should this item's time string be presented in?setTimeFormatter24Hour(TimeDisplayFormat timeFormatter24Hour) IfuseTextFieldis true, anduse24HourTimeis 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 fieldand if supported by the browser, should the HTML5placeholderattribute be used to display the hint within the field? If set tofalse, then use of theplaceholderattribute 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 tofalsewill 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, valueClippedMethods inherited from class com.smartgwt.client.data.Field
getCanExport, getExportTitle, getPrimaryKey, getSortByField, setCanExport, setExportTitle, setPrimaryKey, setSortByFieldMethods inherited from class com.smartgwt.client.core.RefDataClass
getRef, getRef, internalSetIDMethods 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, setFactoryCreatedMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods 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 whenuseTextFieldis 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:
TimeIteminstance, 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:
TimeIteminstance, 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
IfuseTextFieldis 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
timeFormatterare not supported.In-field hintsare 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:
setBrowserInputTypein classFormItem- Parameters:
browserInputType- New browserInputType value. Default value is null- Returns:
TimeIteminstance, for chaining setter calls
-
getBrowserInputType
IfuseTextFieldis 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
timeFormatterare not supported.In-field hintsare 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:
getBrowserInputTypein classFormItem- Returns:
- Current browserInputType value. Default value is null
-
setHourIncrement
WhenuseTextFieldis false andhourValuesis 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 thehourMinValueandhourMaxValue.- Parameters:
hourIncrement- New hourIncrement value. Default value is null- Returns:
TimeIteminstance, for chaining setter calls
-
getHourIncrement
WhenuseTextFieldis false andhourValuesis 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 thehourMinValueandhourMaxValue.- Returns:
- Current hourIncrement value. Default value is null
-
getHourItem
Select item to hold the hours portion of the time ordurationwhenuseTextFieldis 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:
TimeIteminstance, 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:
TimeIteminstance, 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:
TimeIteminstance, for chaining setter calls- See Also:
-
getHourItemTitle
Title to show for thehour picker.- Returns:
- Current hourItemTitle value. Default value is "Hour"
- See Also:
-
setHourMaxValue
WhenuseTextFieldis false andhourValuesis 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
use24HourTimeandtimeFormatter.See also
hourMinValueandhourIncrement.- Parameters:
hourMaxValue- New hourMaxValue value. Default value is null- Returns:
TimeIteminstance, for chaining setter calls
-
getHourMaxValue
WhenuseTextFieldis false andhourValuesis 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
use24HourTimeandtimeFormatter.See also
hourMinValueandhourIncrement.- Returns:
- Current hourMaxValue value. Default value is null
-
setHourMinValue
WhenuseTextFieldis false andhourValuesis 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
hourMaxValueandhourIncrement.- Parameters:
hourMinValue- New hourMinValue value. Default value is null- Returns:
TimeIteminstance, for chaining setter calls
-
getHourMinValue
WhenuseTextFieldis false andhourValuesis 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
hourMaxValueandhourIncrement.- Returns:
- Current hourMinValue value. Default value is null
-
setHourValues
An array of values to make available in thehour pickerwhenuseTextFieldis 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,hourMaxValueandhourIncrementfor 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 valuesto use whenuseTextFieldis false.Used for limiting available valid Hour values, or when using the TimeItem to record duration, rather than time per-se.
See
hourMinValue,hourMaxValueandhourIncrementfor another method of controlling the content in the hour picker.- Parameters:
hourValues- array of available Hour values. Default value is null- Returns:
TimeIteminstance, for chaining setter calls
-
getHourValues
public int[] getHourValues()An array of values to make available in thehour pickerwhenuseTextFieldis 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,hourMaxValueandhourIncrementfor another method of controlling the content in the hour picker.- Returns:
- Returns an array of the current valid hour values, whether set directly as
hourValuesor generated according tohourMinValue,hourMaxValueandhourIncrement. 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:
TimeIteminstance, 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
WhenuseTextFieldis false, the default title-alignment of child-items such as thehour,minuteandsecondpickers, within their cells.- Parameters:
itemTitleAlign- New itemTitleAlign value. Default value is "center"- Returns:
TimeIteminstance, for chaining setter calls- See Also:
-
getItemTitleAlign
WhenuseTextFieldis false, the default title-alignment of child-items such as thehour,minuteandsecondpickers, within their cells.- Returns:
- Current itemTitleAlign value. Default value is "center"
- See Also:
-
setItemTitleOrientation
WhenuseTextFieldis false, the default orientation of titles for child-items, such as thehour,minuteandsecondpickers.TitleOrientationlists 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:
TimeIteminstance, for chaining setter calls- See Also:
-
getItemTitleOrientation
WhenuseTextFieldis false, the default orientation of titles for child-items, such as thehour,minuteandsecondpickers.TitleOrientationlists 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
WhenuseTextFieldis false andmillisecondValuesis 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 themillisecondMinValueandmillisecondMaxValue.- Parameters:
millisecondIncrement- New millisecondIncrement value. Default value is null- Returns:
TimeIteminstance, for chaining setter calls
-
getMillisecondIncrement
WhenuseTextFieldis false andmillisecondValuesis 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 themillisecondMinValueandmillisecondMaxValue.- Returns:
- Current millisecondIncrement value. Default value is null
-
getMillisecondItem
Select item to hold the milliseconds portion of the time ordurationwhenuseTextFieldis 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:
TimeIteminstance, 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:
TimeIteminstance, 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:
TimeIteminstance, for chaining setter calls- See Also:
-
getMillisecondItemTitle
Title to show for themillisecond picker.- Returns:
- Current millisecondItemTitle value. Default value is "Ms"
- See Also:
-
setMillisecondMaxValue
WhenuseTextFieldis false andmillisecondValuesis 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
millisecondMinValueandmillisecondIncrement.- Parameters:
millisecondMaxValue- New millisecondMaxValue value. Default value is null- Returns:
TimeIteminstance, for chaining setter calls
-
getMillisecondMaxValue
WhenuseTextFieldis false andmillisecondValuesis 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
millisecondMinValueandmillisecondIncrement.- Returns:
- Current millisecondMaxValue value. Default value is null
-
setMillisecondMinValue
WhenuseTextFieldis false andmillisecondValuesis 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
millisecondMaxValueandmillisecondIncrement.- Parameters:
millisecondMinValue- New millisecondMinValue value. Default value is null- Returns:
TimeIteminstance, for chaining setter calls
-
getMillisecondMinValue
WhenuseTextFieldis false andmillisecondValuesis 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
millisecondMaxValueandmillisecondIncrement.- Returns:
- Current millisecondMinValue value. Default value is null
-
setMillisecondValues
An array of values to make available in themillisecond pickerwhenuseTextFieldis 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,millisecondMaxValueandmillisecondIncrementfor 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 valuesto use whenuseTextFieldis false.Used for limiting available valid Millisecond values, or when using the TimeItem to record duration, rather than time per-se.
See
millisecondMinValue,millisecondMaxValueandmillisecondIncrementfor another method of controlling the content in the millisecond picker.- Parameters:
millisecondValues- array of available Millisecond values. Default value is null- Returns:
TimeIteminstance, for chaining setter calls
-
getMillisecondValues
public int[] getMillisecondValues()An array of values to make available in themillisecond pickerwhenuseTextFieldis 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,millisecondMaxValueandmillisecondIncrementfor another method of controlling the content in the millisecond picker.- Returns:
- Returns an array of the current valid millisecond values, whether set directly as
millisecondValuesor generated according tomillisecondMinValue,millisecondMaxValueandmillisecondIncrement. Default value is null
-
setMinuteIncrement
WhenuseTextFieldis false andminuteValuesis 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 theminuteMinValueandminuteMaxValue.- Parameters:
minuteIncrement- New minuteIncrement value. Default value is null- Returns:
TimeIteminstance, for chaining setter calls
-
getMinuteIncrement
WhenuseTextFieldis false andminuteValuesis 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 theminuteMinValueandminuteMaxValue.- Returns:
- Current minuteIncrement value. Default value is null
-
getMinuteItem
Select item to hold the minutes portion of the time ordurationwhenuseTextFieldis 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:
TimeIteminstance, 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:
TimeIteminstance, 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:
TimeIteminstance, for chaining setter calls- See Also:
-
getMinuteItemTitle
Title to show for theminute picker.- Returns:
- Current minuteItemTitle value. Default value is "Min"
- See Also:
-
setMinuteMaxValue
WhenuseTextFieldis false andminuteValuesis 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
minuteMinValueandminuteIncrement.- Parameters:
minuteMaxValue- New minuteMaxValue value. Default value is null- Returns:
TimeIteminstance, for chaining setter calls
-
getMinuteMaxValue
WhenuseTextFieldis false andminuteValuesis 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
minuteMinValueandminuteIncrement.- Returns:
- Current minuteMaxValue value. Default value is null
-
setMinuteMinValue
WhenuseTextFieldis false andminuteValuesis 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
minuteMaxValueandminuteIncrement.- Parameters:
minuteMinValue- New minuteMinValue value. Default value is null- Returns:
TimeIteminstance, for chaining setter calls
-
getMinuteMinValue
WhenuseTextFieldis false andminuteValuesis 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
minuteMaxValueandminuteIncrement.- Returns:
- Current minuteMinValue value. Default value is null
-
setMinuteValues
An array of values to make available in theminute pickerwhenuseTextFieldis 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,minuteMaxValueandminuteIncrementfor 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 valuesto use whenuseTextFieldis false.Used for limiting available valid Minute values, or when using the TimeItem to record duration, rather than time per-se.
See
minuteMinValue,minuteMaxValueandminuteIncrementfor another method of controlling the content in the minute picker.- Parameters:
minuteValues- array of available Minute values. Default value is null- Returns:
TimeIteminstance, for chaining setter calls
-
getMinuteValues
public int[] getMinuteValues()An array of values to make available in theminute pickerwhenuseTextFieldis 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,minuteMaxValueandminuteIncrementfor another method of controlling the content in the minute picker.- Returns:
- Returns an array of the current valid minute values, whether set directly as
minuteValuesor generated according tominuteMinValue,minuteMaxValueandminuteIncrement. Default value is null
-
setSecondIncrement
WhenuseTextFieldis false andsecondValuesis 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 thesecondMinValueandsecondMaxValue.- Parameters:
secondIncrement- New secondIncrement value. Default value is null- Returns:
TimeIteminstance, for chaining setter calls
-
getSecondIncrement
WhenuseTextFieldis false andsecondValuesis 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 thesecondMinValueandsecondMaxValue.- Returns:
- Current secondIncrement value. Default value is null
-
getSecondItem
Select item to hold the seconds portion of the time ordurationwhenuseTextFieldis 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:
TimeIteminstance, 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:
TimeIteminstance, 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:
TimeIteminstance, for chaining setter calls- See Also:
-
getSecondItemTitle
Title to show for thesecond picker.- Returns:
- Current secondItemTitle value. Default value is "Sec"
- See Also:
-
setSecondMaxValue
WhenuseTextFieldis false andsecondValuesis 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
secondMinValueandsecondIncrement.- Parameters:
secondMaxValue- New secondMaxValue value. Default value is null- Returns:
TimeIteminstance, for chaining setter calls
-
getSecondMaxValue
WhenuseTextFieldis false andsecondValuesis 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
secondMinValueandsecondIncrement.- Returns:
- Current secondMaxValue value. Default value is null
-
setSecondMinValue
WhenuseTextFieldis false andsecondValuesis 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
secondMaxValueandsecondIncrement.- Parameters:
secondMinValue- New secondMinValue value. Default value is null- Returns:
TimeIteminstance, for chaining setter calls
-
getSecondMinValue
WhenuseTextFieldis false andsecondValuesis 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
secondMaxValueandsecondIncrement.- Returns:
- Current secondMinValue value. Default value is null
-
setSecondValues
An array of values to make available in thesecond pickerwhenuseTextFieldis 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,secondMaxValueandsecondIncrementfor 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 valuesto use whenuseTextFieldis false.Used for limiting available valid Second values, or when using the TimeItem to record duration, rather than time per-se.
See
secondMinValue,secondMaxValueandsecondIncrementfor another method of controlling the content in the second picker.- Parameters:
secondValues- array of available Second values. Default value is null- Returns:
TimeIteminstance, for chaining setter calls
-
getSecondValues
public int[] getSecondValues()An array of values to make available in thesecond pickerwhenuseTextFieldis 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,secondMaxValueandsecondIncrementfor another method of controlling the content in the second picker.- Returns:
- Returns an array of the current valid second values, whether set directly as
secondValuesor generated according tosecondMinValue,secondMaxValueandsecondIncrement. Default value is null
-
setShowHintInField
IfuseTextFieldis true and ahintis 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:
TimeIteminstance, for chaining setter calls- See Also:
-
getShowHintInField
IfuseTextFieldis true and ahintis 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 thehourItemwhenuseTextFieldis false.- Parameters:
showHourItem- New showHourItem value. Default value is true- Returns:
TimeIteminstance, for chaining setter calls
-
getShowHourItem
Controls whether to display thehourItemwhenuseTextFieldis false.- Returns:
- Current showHourItem value. Default value is true
-
setShowItemTitles
WhenuseTextFieldis false, whether titles should be shown for for child-items in this TimeItem. By default,showItemTitlesis true, and titles are displayedabove the items.- Parameters:
showItemTitles- New showItemTitles value. Default value is true- Returns:
TimeIteminstance, for chaining setter calls- See Also:
-
getShowItemTitles
WhenuseTextFieldis false, whether titles should be shown for for child-items in this TimeItem. By default,showItemTitlesis true, and titles are displayedabove the items.- Returns:
- Current showItemTitles value. Default value is true
- See Also:
-
setShowMillisecondItem
Controls whether to display themillisecondItemwhenuseTextFieldis false.- Parameters:
showMillisecondItem- New showMillisecondItem value. Default value is false- Returns:
TimeIteminstance, for chaining setter calls
-
getShowMillisecondItem
Controls whether to display themillisecondItemwhenuseTextFieldis false.- Returns:
- Current showMillisecondItem value. Default value is false
-
setShowMinuteItem
Controls whether to display theminuteItemwhenuseTextFieldis false.- Parameters:
showMinuteItem- New showMinuteItem value. Default value is true- Returns:
TimeIteminstance, for chaining setter calls
-
getShowMinuteItem
Controls whether to display theminuteItemwhenuseTextFieldis false.- Returns:
- Current showMinuteItem value. Default value is true
-
setShowSecondItem
Controls whether to display thesecondItemwhenuseTextFieldis false.- Parameters:
showSecondItem- New showSecondItem value. Default value is true- Returns:
TimeIteminstance, for chaining setter calls
-
getShowSecondItem
Controls whether to display thesecondItemwhenuseTextFieldis false.- Returns:
- Current showSecondItem value. Default value is true
-
setTextAlign
IfuseTextFieldistrue, 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:
setTextAlignin classFormItem- Parameters:
textAlign- New textAlign value. Default value is varies- Returns:
TimeIteminstance, for chaining setter calls- See Also:
-
getTextAlign
IfuseTextFieldistrue, 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:
getTextAlignin 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 thetextFieldifuseTextFieldis set totrue.- Overrides:
setTextBoxStylein classFormItem- Parameters:
textBoxStyle- New textBoxStyle value. Default value is null- Returns:
TimeIteminstance, for chaining setter calls- See Also:
-
getTextBoxStyle
Base CSS class for this item's text box. If specified this style will be applied to thetextFieldifuseTextFieldis set totrue.- Overrides:
getTextBoxStylein classFormItem- Returns:
- Current textBoxStyle value. Default value is null
- See Also:
-
getTextField
Text field to hold the entire time in "type in" format, ifuseTextFieldis 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 fieldgenerated for this timeItem whenuseTextFieldis true.Note : This is an advanced setting
- Parameters:
textFieldProperties- New textFieldProperties value. Default value is null- Returns:
TimeIteminstance, for chaining setter calls
-
getTextFieldProperties
Custom properties to apply to thetext fieldgenerated for this timeItem whenuseTextFieldis true.- Returns:
- Current textFieldProperties value. Default value is null
-
setTimeFormatter
IfuseTextFieldis true, what format should this item's time string be presented in?If unset, the default formatter will be
timeFormatter24HourortimeFormatter12Hourdepending 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:
setTimeFormatterin classFormItem- Parameters:
timeFormatter- New timeFormatter value. Default value is null- Returns:
TimeIteminstance, for chaining setter calls- See Also:
-
getTimeFormatter
IfuseTextFieldis true, what format should this item's time string be presented in?If unset, the default formatter will be
timeFormatter24HourortimeFormatter12Hourdepending 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:
getTimeFormatterin classFormItem- Returns:
- Current timeFormatter value. Default value is null
- See Also:
-
setTimeFormatter12Hour
IfuseTextFieldis true, anduse24HourTimeis 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:
TimeIteminstance, for chaining setter calls
-
getTimeFormatter12Hour
IfuseTextFieldis true, anduse24HourTimeis 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
IfuseTextFieldis true, anduse24HourTimeis 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:
TimeIteminstance, for chaining setter calls
-
getTimeFormatter24Hour
IfuseTextFieldis true, anduse24HourTimeis 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:
TimeIteminstance, 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
timeFormatteris 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:
TimeIteminstance, 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
timeFormatteris 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 fieldand if supported by the browser, should the HTML5placeholderattribute be used to display the hint within the field? If set tofalse, then use of theplaceholderattribute is disabled and an alternative technique to display the hint in-field is used instead.The HTML5
placeholderattribute 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
placeholderattribute. 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-placeholderFirefox 4 - 18 :-moz-placeholderFirefox 19+ ::-moz-placeholderInternet Explorer :-ms-input-placeholderNote 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-placeholdermixin 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:
TimeIteminstance, for chaining setter calls- See Also:
-
getUsePlaceholderForHint
public boolean getUsePlaceholderForHint()Ifshowing the hint in fieldand if supported by the browser, should the HTML5placeholderattribute be used to display the hint within the field? If set tofalse, then use of theplaceholderattribute is disabled and an alternative technique to display the hint in-field is used instead.The HTML5
placeholderattribute 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
placeholderattribute. 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-placeholderFirefox 4 - 18 :-moz-placeholderFirefox 19+ ::-moz-placeholderInternet Explorer :-ms-input-placeholderNote 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-placeholdermixin 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:
TimeIteminstance, 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 tofalsewill 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.wrapHintTextsetting.This setting does not apply to hints that are
shown in field.- Overrides:
setWrapHintTextin classFormItem- Parameters:
wrapHintText- New wrapHintText value. Default value is false- Returns:
TimeIteminstance, 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 tofalsewill 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.wrapHintTextsetting.This setting does not apply to hints that are
shown in field.- Overrides:
getWrapHintTextin classFormItem- Returns:
- Current wrapHintText value. Default value is false
- See Also:
-
deselectValue
public void deselectValue()IfuseTextFieldis true, falls through to standarddeselectValue()implementation on this items freeform text entry field. Otherwise has no effect. -
deselectValue
IfuseTextFieldis 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()WhenuseTextFieldis set to false, this method returns the value of the time expressed as a duration in thetimeUnitprovided. 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
WhenuseTextFieldis set to false, this method returns the value of the time expressed as a duration in thetimeUnitprovided. 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 ifuseTextFieldis 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 whenshowPendingis enabled and this time item should either clear or show its pending visual state.The default behavior is that the
titleStyleandcellStyleare updated to include/exclude the "Pending" suffix. In addition, when displayed in the pending state:- If
useTextFieldistrue, then the "Pending" suffix will be appended to thetextBoxStyleapplied to thetextField; otherwise - (
useTextFieldisfalse) the color of thehourItem,minuteItem,secondItem,millisecondItem, and/orampmItemwill change when the hour, minute, second, millisecond, or whether the time is AM or PM is different, respectively.
falsewill cancel this default behavior.- Parameters:
form- the managingDynamicForminstance.item- the form item itself (also available as "this").pendingStatus-trueif the item should show its pending visual state;falseotherwise.newValue- the current form item value.value- the value that would be restored by a call toDynamicForm.resetValues().- Returns:
falseto cancel the default behavior.
- If
-
selectValue
public void selectValue()IfuseTextFieldis 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) IfuseTextFieldis true, falls through to standardsetSelectionRangeimplementation 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:
setDisplayFormatin 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()IfuseTextFieldis true, falls through to standardcom.smartgwt.client.widgets.form.fields.FormItem#getSelectionRangeimplementation 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.