Class DateSettings
- java.lang.Object
-
- com.jalios.jcms.taglib.settings.BasicSettings<T>
-
- com.jalios.jcms.taglib.settings.AbstractTextSettings<DateSettings>
-
- com.jalios.jcms.taglib.settings.impl.DateSettings
-
- All Implemented Interfaces:
ControlSettings<DateSettings>,java.lang.Cloneable
public class DateSettings extends AbstractTextSettings<DateSettings>
Date Settings- Author:
- Nicolas Dos Santos
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringDISPLAY_TIME-
Fields inherited from class com.jalios.jcms.taglib.settings.BasicSettings
APPEND, ARIA_ATTR_PREFIX, ARIA_ATTRIBUTES, AUTOFOCUS, CLEAR_BUTTON, CSS, DATA_ATTR_PREFIX, DATA_ATTRIBUTES, DISABLED, HIDE_CLEAR_BUTTON, HTML_ATTRIBUTES, ID, LANGUAGE_CHOOSER, MAX_LENGTH, NAME, PLACEHOLDER, PREPEND, READONLY, REQUIRED, TITLE, TRIGGER_ACTION, TRIGGER_EVENT, VALUE
-
-
Constructor Summary
Constructors Constructor Description DateSettings()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description DateSettingsdisplayDateOnly()Specify whether the control displays only the date (not the time) and allows only the date (not the time) to be selected in the datepicker.DateSettingsdisplayTime()Specify whether the control display the time and allows the time to be selected in the datepicker.protected DateSettingsgetThis()Returns the exact type of the this reference.
It's a way to recover the type of thethisobject in a class hierarchy (cf.ControlTypegetType()Returns theControlTyperelated to the currentControlSettingsimplementation.DateSettingsonChange(java.lang.String action)Bind the "change" event to the given databroker action.
Example:voidresolveOptions(TypeFieldEntry tfe)Set options from the specifiedTypeFieldEntry.-
Methods inherited from class com.jalios.jcms.taglib.settings.BasicSettings
addOption, append, aria, aria, autofocus, clearOption, clone, css, dataAttribute, dataAttribute, dataAttributes, disable, getOption, getOptionNames, htmlAttributes, htmlAttributes, id, isChannelReady, maxLength, merge, name, onFocusOut, placeholder, prepend, readonly, removeOption, require, showLanguageChooser, sortSet, title, toStringArray, toStringArray, toStringArray, toStringArray, toStringArray, trigger, value
-
-
-
-
Field Detail
-
DISPLAY_TIME
public static final java.lang.String DISPLAY_TIME
- See Also:
- Constant Field Values
-
-
Method Detail
-
getType
public ControlType getType()
Description copied from interface:ControlSettingsReturns theControlTyperelated to the currentControlSettingsimplementation.- Returns:
ControlType
-
getThis
protected DateSettings getThis()
Description copied from class:BasicSettingsReturns the exact type of the this reference.
It's a way to recover the type of thethisobject in a class hierarchy (cf. getThis "trick").- Specified by:
getThisin classBasicSettings<DateSettings>- Returns:
- The exact type of the this reference
-
resolveOptions
public void resolveOptions(TypeFieldEntry tfe)
Description copied from interface:ControlSettingsSet options from the specifiedTypeFieldEntry.- Specified by:
resolveOptionsin interfaceControlSettings<DateSettings>- Overrides:
resolveOptionsin classBasicSettings<DateSettings>- Parameters:
tfe-TypeFieldEntry
-
onChange
public DateSettings onChange(java.lang.String action)
Description copied from class:BasicSettingsBind the "change" event to the given databroker action.
Example:<jalios:field name="mytextfield" label="My Textfield" description="<span class='label label-info'>Reversed string: <em class='reverse-string'></em></span>"> <jalios:control settings='<%= new TextFieldSettings().onChange("reverse") %>' /> </jalios:field> <jalios:javascript> !function ($) { // Action regexp var pattern = /reverse/i; var callback = function(event) { var broker = $.jalios.Event.match(event, 'broker', pattern, true); if (!broker){ return; } // Element var elm = broker.source.currentTarget; broker.options._broked = true; var reverseString = $(elm).val().split('').reverse().join(''); $(elm).closest('.widget-content').find('.help-block .reverse-string').html(reverseString); } var register = function() { // Register to broker $(document).on("jalios:broker", callback); } // Initialization on DOM ready $(document).ready(function($) { register(); }); }(window.jQuery); </jalios:javascript>- Overrides:
onChangein classAbstractTextSettings<DateSettings>- Parameters:
action- databroker action- Returns:
- a reference to this object - used to chain calls
-
displayTime
public DateSettings displayTime()
Specify whether the control display the time and allows the time to be selected in the datepicker.- Returns:
- a reference to this object - used to chain calls
-
displayDateOnly
public DateSettings displayDateOnly()
Specify whether the control displays only the date (not the time) and allows only the date (not the time) to be selected in the datepicker.- Returns:
-
-