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

public class TimeItem extends FormItem
A 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.

  • Constructor Details

    • TimeItem

      public TimeItem()
    • TimeItem

      public TimeItem(JavaScriptObject jsObj)
    • TimeItem

      public TimeItem(String name)
    • TimeItem

      public TimeItem(String name, String title)
  • Method Details

    • getOrCreateRef

      public static TimeItem getOrCreateRef(JavaScriptObject jsObj)
    • changeAutoChildDefaults

      public static void changeAutoChildDefaults(String autoChildName, Canvas defaults)
      Changes the defaults for Canvas AutoChildren named autoChildName.
      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, see SGWTProperties.
      See Also:
    • changeAutoChildDefaults

      public static void changeAutoChildDefaults(String autoChildName, FormItem defaults)
      Changes the defaults for FormItem AutoChildren named autoChildName.
      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, see SGWTProperties.
      See Also:
    • changePickerIconDefaults

      public static void changePickerIconDefaults(FormItemIcon defaults)
    • getAmpmItem

      public SelectItem getAmpmItem()
      Select item to hold the AM/PM value for the timeItem when useTextField 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

      public TimeItem setAmpmItemProperties(SelectItem ampmItemProperties)
      Custom properties to apply to this timeItem's generated AM/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

      public SelectItem getAmpmItemProperties()
      Custom properties to apply to this timeItem's generated AM/PM picker.
      Returns:
      Current ampmItemProperties value. Default value is null
    • setAmpmItemTitle

      public TimeItem setAmpmItemTitle(String ampmItemTitle)
      Title to show for the AM/PM picker.
      Parameters:
      ampmItemTitle - New ampmItemTitle value. Default value is "AM/PM"
      Returns:
      TimeItem instance, for chaining setter calls
      See Also:
    • getAmpmItemTitle

      public String getAmpmItemTitle()
      Title to show for the AM/PM picker.
      Returns:
      Current ampmItemTitle value. Default value is "AM/PM"
      See Also:
    • setBrowserInputType

      public TimeItem setBrowserInputType(String browserInputType)
      If useTextField 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 class FormItem
      Parameters:
      browserInputType - New browserInputType value. Default value is null
      Returns:
      TimeItem instance, for chaining setter calls
    • getBrowserInputType

      public String getBrowserInputType()
      If useTextField 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 class FormItem
      Returns:
      Current browserInputType value. Default value is null
    • setHourIncrement

      public TimeItem setHourIncrement(Integer hourIncrement)
      When useTextField is false and hourValues 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 the hourMinValue and hourMaxValue.
      Parameters:
      hourIncrement - New hourIncrement value. Default value is null
      Returns:
      TimeItem instance, for chaining setter calls
    • getHourIncrement

      public Integer getHourIncrement()
      When useTextField is false and hourValues 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 the hourMinValue and hourMaxValue.
      Returns:
      Current hourIncrement value. Default value is null
    • getHourItem

      public SelectItem getHourItem()
      Select item to hold the hours portion of the time or duration when useTextField 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

      public TimeItem setHourItemPrompt(String hourItemPrompt)
      The hover prompt to show for the hour picker.
      Parameters:
      hourItemPrompt - New hourItemPrompt value. Default value is "Choose hours"
      Returns:
      TimeItem instance, for chaining setter calls
      See Also:
    • getHourItemPrompt

      public String getHourItemPrompt()
      The hover prompt to show for the hour picker.
      Returns:
      Current hourItemPrompt value. Default value is "Choose hours"
      See Also:
    • setHourItemProperties

      public TimeItem setHourItemProperties(SelectItem hourItemProperties)
      Custom properties to apply to this timeItem's generated hour picker.

      Note : This is an advanced setting

      Parameters:
      hourItemProperties - New hourItemProperties value. Default value is null
      Returns:
      TimeItem instance, for chaining setter calls
    • getHourItemProperties

      public SelectItem getHourItemProperties()
      Custom properties to apply to this timeItem's generated hour picker.
      Returns:
      Current hourItemProperties value. Default value is null
    • setHourItemTitle

      public TimeItem setHourItemTitle(String hourItemTitle)
      Title to show for the hour picker.
      Parameters:
      hourItemTitle - New hourItemTitle value. Default value is "Hour"
      Returns:
      TimeItem instance, for chaining setter calls
      See Also:
    • getHourItemTitle

      public String getHourItemTitle()
      Title to show for the hour picker.
      Returns:
      Current hourItemTitle value. Default value is "Hour"
      See Also:
    • setHourMaxValue

      public TimeItem setHourMaxValue(Integer hourMaxValue)
      When useTextField is false and hourValues 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 and timeFormatter.

      See also hourMinValue and hourIncrement.

      Parameters:
      hourMaxValue - New hourMaxValue value. Default value is null
      Returns:
      TimeItem instance, for chaining setter calls
    • getHourMaxValue

      public Integer getHourMaxValue()
      When useTextField is false and hourValues 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 and timeFormatter.

      See also hourMinValue and hourIncrement.

      Returns:
      Current hourMaxValue value. Default value is null
    • setHourMinValue

      public TimeItem setHourMinValue(Integer hourMinValue)
      When useTextField is false and hourValues 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 and hourIncrement.

      Parameters:
      hourMinValue - New hourMinValue value. Default value is null
      Returns:
      TimeItem instance, for chaining setter calls
    • getHourMinValue

      public Integer getHourMinValue()
      When useTextField is false and hourValues 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 and hourIncrement.

      Returns:
      Current hourMinValue value. Default value is null
    • setHourValues

      public TimeItem setHourValues(int... hourValues)
      An array of values to make available in the hour picker when useTextField 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 and hourIncrement 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 valid hour values to use when useTextField 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 and hourIncrement 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 the hour picker when useTextField 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 and hourIncrement 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 to hourMinValue, hourMaxValue and hourIncrement. Default value is null
    • setInvalidTimeStringMessage

      public TimeItem setInvalidTimeStringMessage(String invalidTimeStringMessage)
      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

      public String 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

      public TimeItem setItemTitleAlign(Alignment itemTitleAlign)
      When useTextField is false, the default title-alignment of child-items such as the hour, minute and second pickers, within their cells.
      Parameters:
      itemTitleAlign - New itemTitleAlign value. Default value is "center"
      Returns:
      TimeItem instance, for chaining setter calls
      See Also:
    • getItemTitleAlign

      public Alignment getItemTitleAlign()
      When useTextField is false, the default title-alignment of child-items such as the hour, minute and second pickers, within their cells.
      Returns:
      Current itemTitleAlign value. Default value is "center"
      See Also:
    • setItemTitleOrientation

      public TimeItem setItemTitleOrientation(TitleOrientation itemTitleOrientation)
      When useTextField is false, the default orientation of titles for child-items, such as the hour, minute and second 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

      public TitleOrientation getItemTitleOrientation()
      When useTextField is false, the default orientation of titles for child-items, such as the hour, minute and second 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

      public TimeItem setMillisecondIncrement(Integer millisecondIncrement)
      When useTextField is false and millisecondValues 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 the millisecondMinValue and millisecondMaxValue.
      Parameters:
      millisecondIncrement - New millisecondIncrement value. Default value is null
      Returns:
      TimeItem instance, for chaining setter calls
    • getMillisecondIncrement

      public Integer getMillisecondIncrement()
      When useTextField is false and millisecondValues 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 the millisecondMinValue and millisecondMaxValue.
      Returns:
      Current millisecondIncrement value. Default value is null
    • getMillisecondItem

      public SelectItem getMillisecondItem()
      Select item to hold the milliseconds portion of the time or duration when useTextField 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

      public TimeItem setMillisecondItemPrompt(String millisecondItemPrompt)
      The hover prompt to show for the millisecond picker.
      Parameters:
      millisecondItemPrompt - New millisecondItemPrompt value. Default value is "Choose milliseconds"
      Returns:
      TimeItem instance, for chaining setter calls
      See Also:
    • getMillisecondItemPrompt

      public String getMillisecondItemPrompt()
      The hover prompt to show for the millisecond picker.
      Returns:
      Current millisecondItemPrompt value. Default value is "Choose milliseconds"
      See Also:
    • setMillisecondItemProperties

      public TimeItem setMillisecondItemProperties(SelectItem millisecondItemProperties)
      Custom properties to apply to this timeItem's generated millisecond picker.

      Note : This is an advanced setting

      Parameters:
      millisecondItemProperties - New millisecondItemProperties value. Default value is null
      Returns:
      TimeItem instance, for chaining setter calls
    • getMillisecondItemProperties

      public SelectItem getMillisecondItemProperties()
      Custom properties to apply to this timeItem's generated millisecond picker.
      Returns:
      Current millisecondItemProperties value. Default value is null
    • setMillisecondItemTitle

      public TimeItem setMillisecondItemTitle(String millisecondItemTitle)
      Title to show for the millisecond picker.
      Parameters:
      millisecondItemTitle - New millisecondItemTitle value. Default value is "Ms"
      Returns:
      TimeItem instance, for chaining setter calls
      See Also:
    • getMillisecondItemTitle

      public String getMillisecondItemTitle()
      Title to show for the millisecond picker.
      Returns:
      Current millisecondItemTitle value. Default value is "Ms"
      See Also:
    • setMillisecondMaxValue

      public TimeItem setMillisecondMaxValue(Integer millisecondMaxValue)
      When useTextField is false and millisecondValues 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 and millisecondIncrement.

      Parameters:
      millisecondMaxValue - New millisecondMaxValue value. Default value is null
      Returns:
      TimeItem instance, for chaining setter calls
    • getMillisecondMaxValue

      public Integer getMillisecondMaxValue()
      When useTextField is false and millisecondValues 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 and millisecondIncrement.

      Returns:
      Current millisecondMaxValue value. Default value is null
    • setMillisecondMinValue

      public TimeItem setMillisecondMinValue(Integer millisecondMinValue)
      When useTextField is false and millisecondValues 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 and millisecondIncrement.

      Parameters:
      millisecondMinValue - New millisecondMinValue value. Default value is null
      Returns:
      TimeItem instance, for chaining setter calls
    • getMillisecondMinValue

      public Integer getMillisecondMinValue()
      When useTextField is false and millisecondValues 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 and millisecondIncrement.

      Returns:
      Current millisecondMinValue value. Default value is null
    • setMillisecondValues

      public TimeItem setMillisecondValues(int... millisecondValues)
      An array of values to make available in the millisecond picker when useTextField 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 and millisecondIncrement 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 valid millisecond values to use when useTextField 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 and millisecondIncrement 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 the millisecond picker when useTextField 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 and millisecondIncrement 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 to millisecondMinValue, millisecondMaxValue and millisecondIncrement. Default value is null
    • setMinuteIncrement

      public TimeItem setMinuteIncrement(Integer minuteIncrement)
      When useTextField is false and minuteValues 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 the minuteMinValue and minuteMaxValue.
      Parameters:
      minuteIncrement - New minuteIncrement value. Default value is null
      Returns:
      TimeItem instance, for chaining setter calls
    • getMinuteIncrement

      public Integer getMinuteIncrement()
      When useTextField is false and minuteValues 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 the minuteMinValue and minuteMaxValue.
      Returns:
      Current minuteIncrement value. Default value is null
    • getMinuteItem

      public SelectItem getMinuteItem()
      Select item to hold the minutes portion of the time or duration when useTextField 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

      public TimeItem setMinuteItemPrompt(String minuteItemPrompt)
      The hover prompt to show for the minute picker.
      Parameters:
      minuteItemPrompt - New minuteItemPrompt value. Default value is "Choose minutes"
      Returns:
      TimeItem instance, for chaining setter calls
      See Also:
    • getMinuteItemPrompt

      public String getMinuteItemPrompt()
      The hover prompt to show for the minute picker.
      Returns:
      Current minuteItemPrompt value. Default value is "Choose minutes"
      See Also:
    • setMinuteItemProperties

      public TimeItem setMinuteItemProperties(SelectItem minuteItemProperties)
      Custom properties to apply to this timeItem's generated minute picker.

      Note : This is an advanced setting

      Parameters:
      minuteItemProperties - New minuteItemProperties value. Default value is null
      Returns:
      TimeItem instance, for chaining setter calls
    • getMinuteItemProperties

      public SelectItem getMinuteItemProperties()
      Custom properties to apply to this timeItem's generated minute picker.
      Returns:
      Current minuteItemProperties value. Default value is null
    • setMinuteItemTitle

      public TimeItem setMinuteItemTitle(String minuteItemTitle)
      Title to show for the minute picker.
      Parameters:
      minuteItemTitle - New minuteItemTitle value. Default value is "Min"
      Returns:
      TimeItem instance, for chaining setter calls
      See Also:
    • getMinuteItemTitle

      public String getMinuteItemTitle()
      Title to show for the minute picker.
      Returns:
      Current minuteItemTitle value. Default value is "Min"
      See Also:
    • setMinuteMaxValue

      public TimeItem setMinuteMaxValue(Integer minuteMaxValue)
      When useTextField is false and minuteValues 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 and minuteIncrement.

      Parameters:
      minuteMaxValue - New minuteMaxValue value. Default value is null
      Returns:
      TimeItem instance, for chaining setter calls
    • getMinuteMaxValue

      public Integer getMinuteMaxValue()
      When useTextField is false and minuteValues 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 and minuteIncrement.

      Returns:
      Current minuteMaxValue value. Default value is null
    • setMinuteMinValue

      public TimeItem setMinuteMinValue(Integer minuteMinValue)
      When useTextField is false and minuteValues 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 and minuteIncrement.

      Parameters:
      minuteMinValue - New minuteMinValue value. Default value is null
      Returns:
      TimeItem instance, for chaining setter calls
    • getMinuteMinValue

      public Integer getMinuteMinValue()
      When useTextField is false and minuteValues 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 and minuteIncrement.

      Returns:
      Current minuteMinValue value. Default value is null
    • setMinuteValues

      public TimeItem setMinuteValues(int... minuteValues)
      An array of values to make available in the minute picker when useTextField 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 and minuteIncrement 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 valid minute values to use when useTextField 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 and minuteIncrement 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 the minute picker when useTextField 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 and minuteIncrement 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 to minuteMinValue, minuteMaxValue and minuteIncrement. Default value is null
    • setSecondIncrement

      public TimeItem setSecondIncrement(Integer secondIncrement)
      When useTextField is false and secondValues 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 the secondMinValue and secondMaxValue.
      Parameters:
      secondIncrement - New secondIncrement value. Default value is null
      Returns:
      TimeItem instance, for chaining setter calls
    • getSecondIncrement

      public Integer getSecondIncrement()
      When useTextField is false and secondValues 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 the secondMinValue and secondMaxValue.
      Returns:
      Current secondIncrement value. Default value is null
    • getSecondItem

      public SelectItem getSecondItem()
      Select item to hold the seconds portion of the time or duration when useTextField 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

      public TimeItem setSecondItemPrompt(String secondItemPrompt)
      The hover prompt to show for the second picker.
      Parameters:
      secondItemPrompt - New secondItemPrompt value. Default value is "Choose seconds"
      Returns:
      TimeItem instance, for chaining setter calls
      See Also:
    • getSecondItemPrompt

      public String getSecondItemPrompt()
      The hover prompt to show for the second picker.
      Returns:
      Current secondItemPrompt value. Default value is "Choose seconds"
      See Also:
    • setSecondItemProperties

      public TimeItem setSecondItemProperties(SelectItem secondItemProperties)
      Custom properties to apply to this timeItem's generated seconds picker.

      Note : This is an advanced setting

      Parameters:
      secondItemProperties - New secondItemProperties value. Default value is null
      Returns:
      TimeItem instance, for chaining setter calls
    • getSecondItemProperties

      public SelectItem getSecondItemProperties()
      Custom properties to apply to this timeItem's generated seconds picker.
      Returns:
      Current secondItemProperties value. Default value is null
    • setSecondItemTitle

      public TimeItem setSecondItemTitle(String secondItemTitle)
      Title to show for the second picker.
      Parameters:
      secondItemTitle - New secondItemTitle value. Default value is "Sec"
      Returns:
      TimeItem instance, for chaining setter calls
      See Also:
    • getSecondItemTitle

      public String getSecondItemTitle()
      Title to show for the second picker.
      Returns:
      Current secondItemTitle value. Default value is "Sec"
      See Also:
    • setSecondMaxValue

      public TimeItem setSecondMaxValue(Integer secondMaxValue)
      When useTextField is false and secondValues 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 and secondIncrement.

      Parameters:
      secondMaxValue - New secondMaxValue value. Default value is null
      Returns:
      TimeItem instance, for chaining setter calls
    • getSecondMaxValue

      public Integer getSecondMaxValue()
      When useTextField is false and secondValues 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 and secondIncrement.

      Returns:
      Current secondMaxValue value. Default value is null
    • setSecondMinValue

      public TimeItem setSecondMinValue(Integer secondMinValue)
      When useTextField is false and secondValues 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 and secondIncrement.

      Parameters:
      secondMinValue - New secondMinValue value. Default value is null
      Returns:
      TimeItem instance, for chaining setter calls
    • getSecondMinValue

      public Integer getSecondMinValue()
      When useTextField is false and secondValues 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 and secondIncrement.

      Returns:
      Current secondMinValue value. Default value is null
    • setSecondValues

      public TimeItem setSecondValues(int... secondValues)
      An array of values to make available in the second picker when useTextField 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 and secondIncrement 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 valid second values to use when useTextField 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 and secondIncrement 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 the second picker when useTextField 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 and secondIncrement 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 to secondMinValue, secondMaxValue and secondIncrement. Default value is null
    • setShowHintInField

      public TimeItem setShowHintInField(Boolean showHintInField)
      If useTextField is true and a hint 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

      public Boolean getShowHintInField()
      If useTextField is true and a hint 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

      public TimeItem setShowHourItem(Boolean showHourItem)
      Controls whether to display the hourItem when useTextField is false.
      Parameters:
      showHourItem - New showHourItem value. Default value is true
      Returns:
      TimeItem instance, for chaining setter calls
    • getShowHourItem

      public Boolean getShowHourItem()
      Controls whether to display the hourItem when useTextField is false.
      Returns:
      Current showHourItem value. Default value is true
    • setShowItemTitles

      public TimeItem setShowItemTitles(Boolean showItemTitles)
      When useTextField is false, whether titles should be shown for for child-items in this TimeItem. By default, showItemTitles is true, and titles are displayed above the items.
      Parameters:
      showItemTitles - New showItemTitles value. Default value is true
      Returns:
      TimeItem instance, for chaining setter calls
      See Also:
    • getShowItemTitles

      public Boolean getShowItemTitles()
      When useTextField is false, whether titles should be shown for for child-items in this TimeItem. By default, showItemTitles is true, and titles are displayed above the items.
      Returns:
      Current showItemTitles value. Default value is true
      See Also:
    • setShowMillisecondItem

      public TimeItem setShowMillisecondItem(Boolean showMillisecondItem)
      Controls whether to display the millisecondItem when useTextField is false.
      Parameters:
      showMillisecondItem - New showMillisecondItem value. Default value is false
      Returns:
      TimeItem instance, for chaining setter calls
    • getShowMillisecondItem

      public Boolean getShowMillisecondItem()
      Controls whether to display the millisecondItem when useTextField is false.
      Returns:
      Current showMillisecondItem value. Default value is false
    • setShowMinuteItem

      public TimeItem setShowMinuteItem(Boolean showMinuteItem)
      Controls whether to display the minuteItem when useTextField is false.
      Parameters:
      showMinuteItem - New showMinuteItem value. Default value is true
      Returns:
      TimeItem instance, for chaining setter calls
    • getShowMinuteItem

      public Boolean getShowMinuteItem()
      Controls whether to display the minuteItem when useTextField is false.
      Returns:
      Current showMinuteItem value. Default value is true
    • setShowSecondItem

      public TimeItem setShowSecondItem(Boolean showSecondItem)
      Controls whether to display the secondItem when useTextField is false.
      Parameters:
      showSecondItem - New showSecondItem value. Default value is true
      Returns:
      TimeItem instance, for chaining setter calls
    • getShowSecondItem

      public Boolean getShowSecondItem()
      Controls whether to display the secondItem when useTextField is false.
      Returns:
      Current showSecondItem value. Default value is true
    • setTextAlign

      public TimeItem setTextAlign(Alignment textAlign)
      If useTextField is true, this property governs the alignment of text within the text field. Defaults to "left" by default or "right" if the page is in rtl mode.

      This attribute does not have an effect if a native HTML5 time input is being used. See browserInputType.

      Overrides:
      setTextAlign in class FormItem
      Parameters:
      textAlign - New textAlign value. Default value is varies
      Returns:
      TimeItem instance, for chaining setter calls
      See Also:
    • getTextAlign

      public Alignment getTextAlign()
      If useTextField is true, this property governs the alignment of text within the text field. Defaults to "left" by default or "right" if the page is in rtl mode.

      This attribute does not have an effect if a native HTML5 time input is being used. See browserInputType.

      Overrides:
      getTextAlign in class FormItem
      Returns:
      Current textAlign value. Default value is varies
      See Also:
    • setTextBoxStyle

      public TimeItem setTextBoxStyle(String textBoxStyle)
      Base CSS class for this item's text box. If specified this style will be applied to the textField if useTextField is set to true.
      Overrides:
      setTextBoxStyle in class FormItem
      Parameters:
      textBoxStyle - New textBoxStyle value. Default value is null
      Returns:
      TimeItem instance, for chaining setter calls
      See Also:
    • getTextBoxStyle

      public String getTextBoxStyle()
      Base CSS class for this item's text box. If specified this style will be applied to the textField if useTextField is set to true.
      Overrides:
      getTextBoxStyle in class FormItem
      Returns:
      Current textBoxStyle value. Default value is null
      See Also:
    • getTextField

      public TextItem getTextField()
      Text field to hold the entire time in "type in" format, if useTextField 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

      public TimeItem setTextFieldProperties(TextItem textFieldProperties)
      Custom properties to apply to the text field generated for this timeItem when useTextField 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

      public TextItem getTextFieldProperties()
      Custom properties to apply to the text field generated for this timeItem when useTextField is true.
      Returns:
      Current textFieldProperties value. Default value is null
    • setTimeFormatter

      public TimeItem setTimeFormatter(TimeDisplayFormat timeFormatter)
      If useTextField is true, what format should this item's time string be presented in?

      If unset, the default formatter will be timeFormatter24Hour or timeFormatter12Hour depending on the value of use24HourTime. If the property cannot be derived in this way (none of these properties are set), we'll check DynamicForm.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 class FormItem
      Parameters:
      timeFormatter - New timeFormatter value. Default value is null
      Returns:
      TimeItem instance, for chaining setter calls
      See Also:
    • getTimeFormatter

      public TimeDisplayFormat getTimeFormatter()
      If useTextField is true, what format should this item's time string be presented in?

      If unset, the default formatter will be timeFormatter24Hour or timeFormatter12Hour depending on the value of use24HourTime. If the property cannot be derived in this way (none of these properties are set), we'll check DynamicForm.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 class FormItem
      Returns:
      Current timeFormatter value. Default value is null
      See Also:
    • setTimeFormatter12Hour

      public TimeItem setTimeFormatter12Hour(TimeDisplayFormat timeFormatter12Hour)
      If useTextField is true, and use24HourTime 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

      public TimeDisplayFormat getTimeFormatter12Hour()
      If useTextField is true, and use24HourTime 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

      public TimeItem setTimeFormatter24Hour(TimeDisplayFormat timeFormatter24Hour)
      If useTextField is true, and use24HourTime 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

      public TimeDisplayFormat getTimeFormatter24Hour()
      If useTextField is true, and use24HourTime 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

      public TimeItem setUse24HourTime(Boolean use24HourTime)
      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

      public Boolean 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

      public TimeItem setUseMask(Boolean useMask)
      If true, a data entry mask will be enabled in the field based on the timeFormatter.

      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

      public Boolean getUseMask()
      If true, a data entry mask will be enabled in the field based on the timeFormatter.

      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

      public TimeItem setUsePlaceholderForHint(boolean usePlaceholderForHint)
      If showing the hint in field and if supported by the browser, should the HTML5 placeholder attribute be used to display the hint within the field? If set to false, then use of the placeholder 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 when packaging 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()
      If showing the hint in field and if supported by the browser, should the HTML5 placeholder attribute be used to display the hint within the field? If set to false, then use of the placeholder 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 when packaging 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

      public TimeItem setUseTextField(Boolean useTextField)
      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

      public Boolean 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

      public TimeItem setWrapHintText(Boolean wrapHintText)
      If this item is showing a FormItem.hint, should the hint text be allowed to wrap? Setting this property to false 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 class FormItem
      Parameters:
      wrapHintText - New wrapHintText value. Default value is false
      Returns:
      TimeItem instance, for chaining setter calls
      See Also:
    • getWrapHintText

      public Boolean getWrapHintText()
      If this item is showing a FormItem.hint, should the hint text be allowed to wrap? Setting this property to false 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 class FormItem
      Returns:
      Current wrapHintText value. Default value is false
      See Also:
    • deselectValue

      public void deselectValue()
      If useTextField is true, falls through to standard deselectValue() implementation on this items freeform text entry field. Otherwise has no effect.
    • deselectValue

      public void deselectValue(Boolean start)
      If useTextField is true, falls through to standard deselectValue() 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()
      When useTextField is set to false, this method returns the value of the time expressed as a duration in the timeUnit 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

      public int getDuration(TimeUnit timeUnit)
      When useTextField is set to false, this method returns the value of the time expressed as a duration in the timeUnit 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

      public String getEnteredValue()
      Returns the raw text value typed into this items text field if useTextField 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 when showPending is enabled and this time item should either clear or show its pending visual state.

      The default behavior is that the titleStyle and cellStyle are updated to include/exclude the "Pending" suffix. In addition, when displayed in the pending state:

      Returning false will cancel this default behavior.
      Parameters:
      form - the managing DynamicForm 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 to DynamicForm.resetValues().
      Returns:
      false to cancel the default behavior.
    • selectValue

      public void selectValue()
      If useTextField is true, falls through to standard selectValue() 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 with setValue(), 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 with setValue(), 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)
      If useTextField is true, falls through to standard setSelectionRange implementation on this items freeform text entry field. Otherwise has no effect.
      Parameters:
      start - character index for start of new selection
      end - character index for end of new selection
    • setDefaultProperties

      public static void setDefaultProperties(TimeItem timeItemProperties)
      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

      public Date getValueAsDate()
      Return the value tracked by this form item.
      Returns:
      value of this element
    • setDisplayFormat

      public void setDisplayFormat(TimeFormatter timeFormatter)
      Deprecated.
      What format should this item's time string be presented in?
      Overrides:
      setDisplayFormat in class FormItem
      Parameters:
      timeFormatter - displayFormat Default value is "toShort24HourTime"
      See Also:
    • setDisplayFormat

      @Deprecated public void setDisplayFormat(TimeDisplayFormat timeFormatter)
      Deprecated.
      Use getTimeFormatter() instead.
      What format should this item's time string be presented in?
      Parameters:
      TimeDisplayFormat - displayFormat Default value is "toShort24HourTime"
    • getDisplayFormat

      @Deprecated public TimeDisplayFormat getDisplayFormat()
      What format should this item's time string be presented in?
      Returns:
      TimeDisplayFormat
    • getSelectionRange

      public int[] getSelectionRange()
      If useTextField is true, falls through to standard com.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.