public class AjaxDatePicker extends AjaxComponent
Only one of format or formatter may be bound, if both are unbound the default of %m %d %Y is used. If format is bound, the pattern is used to create an internal formatter for validation. If formatter is bound, its pattern is extracted and used in place of format. The format/formatter is used to control the initial display in the input, the format of the value that the date picker places into the input, and validation of the input contents on form submission. The use of formatter over format is preferred for reasons of efficiency and localization.
FL: The component uses the default Locale to determine the start day of the week. It also uses the current language in ERXLocalizer to translate the day and month names (you must set up the localizations).
NOTE: the AjaxDatePicker does NOT play nice with the AjaxModalDialogOpener. There is some sort of initialization conflict (I think) with Prototype that leaves you with a blank page and the browser waiting forever for something (and I have not been able to determine what it is) as soon as calendar.js loads and initialized. It will work if the page the AMD appears on explicitly loads the calendar.js in it's HEAD:
public void appendToResponse(WOResponse response, WOContext context) { super.appendToResponse(response, context); ERXResponseRewriter.addScriptResourceInHead(response, context(), "Ajax", "calendar.js"); }
SimpleDateFormat
,
NSTimestampFormatter
,
Rails Date Kit,
Serialized FormName | Description |
---|---|
value | the value that will be shown in the input field and set by the date picker (required) |
format | the format to use in the input field (only one of format or formatter may be bound) |
formatter | the formatter to use with the input field (only one of format or formatter may be bound) |
id | HTML ID passed to the input field |
class | CSS class passed to the input field |
style | CSS style passed to the input field |
size | size attribute passed to the input field |
maxlength | maxlength attribute passed to the input field |
name | name attribute passed to the input field |
disabled | passed to the input field |
onDateSelect | JavaScript to execute when a date is selected from the calendar |
fireEvent | false if the onChange event for the input should NOT be fired when a date is selected in the calendar, defaults to true |
manualInput | false if you want to prevent manual input from the user and force him/her to use the date picker, defaults to true |
startDay | specify the first day of week to use 0(Sunday)-6(Saturday). The default use the current localizer. |
dayNames | list of day names (Sunday to Saturday) for localization, English is the default |
monthNames | list of month names for localization, English is the default |
imagesDir | directory to take images from, takes them from Ajax.framework by default |
locale | FL: locale can be set if ERXLocalizer returns the wrong one. IE the English localizer returns a US Locale. If you want the UK one then set this binding. |
showYearControls: | display the prev and next year controls. Default to true. |
calendarCSS | name of CSS resource with classed for calendar, defaults to "calendar.css" |
calendarCSSFramework | name of framework (null for application) containing calendarCSS resource, defaults to "Ajax" |
WOComponent._EventLoggingEnabler, WOComponent.Event
NSKeyValueCodingAdditions.DefaultImplementation, NSKeyValueCodingAdditions.Utility
NSKeyValueCoding._BooleanFieldBinding, NSKeyValueCoding._BooleanMethodBinding, NSKeyValueCoding._FieldBinding, NSKeyValueCoding._ForwardingBinding, NSKeyValueCoding._KeyBinding, NSKeyValueCoding._KeyBindingCreation, NSKeyValueCoding._MethodBinding, NSKeyValueCoding._NumberFieldBinding, NSKeyValueCoding._NumberMethodBinding, NSKeyValueCoding._ReflectionKeyBindingCreation, NSKeyValueCoding.ErrorHandling, NSKeyValueCoding.MapImplementation, NSKeyValueCoding.Null<T>, NSKeyValueCoding.UnknownKeyException, NSKeyValueCoding.ValueAccessor
NSValidation._MethodBinding, NSValidation._ValidationBinding, NSValidation.DefaultImplementation, NSValidation.Utility, NSValidation.ValidationException
_Extension, _IsEventLoggingEnabled, _keyAssociations
_CLASS
_CLASS, _KeyPathSeparatorChar, KeyPathSeparator
NullValue
_CLASS
Constructor and Description |
---|
AjaxDatePicker(WOContext context) |
Modifier and Type | Method and Description |
---|---|
protected void |
addRequiredWebResources(WOResponse response)
Includes calendar.css and calendar.js.
|
void |
appendToResponse(WOResponse res,
WOContext ctx)
Sets up AjaxOptions prior to rendering.
|
void |
awake()
Sets up format / formatter values.
|
protected String |
cssFileFrameworkName() |
protected String |
cssFileName() |
NSArray<String> |
dayNames() |
String |
format() |
Format |
formatter() |
WOActionResults |
handleRequest(WORequest request,
WOContext context)
No action so nothing for us to handle.
|
boolean |
isStateless() |
Locale |
locale() |
NSArray<String> |
monthNames() |
String |
onClickScript() |
String |
onFocusScript() |
NSMutableDictionary |
options() |
String |
otherTagString() |
void |
reset()
Clear cached values.
|
String |
showCalendarScript() |
Integer |
startDay() |
String |
translateSimpleDateFormatSymbols(String symbols)
Quick and rude translation of formatting symbols from SimpleDateFormat to the symbols
that this component uses.
|
void |
validationFailedWithException(Throwable t,
Object value,
String keyPath)
Overridden so that parent will handle in the same manner as if this were a dynamic element.
|
_containerID, addScriptResourceInHead, addScriptResourceInHead, addStylesheetResourceInHead, addStylesheetResourceInHead, appendTagAttributeToResponse, booleanValueForBinding, invokeAction, safeElementID, shouldHandleRequest, valueForBinding, valueForBinding, valueForBinding
__valueForBinding, _associationWithName, _awakeInContext, _childTemplate, _cleanUpStatelessComponent, _componentDefinition, _componentUnroll, _isPage, _setContext, _setIsPage, _setParent, _setSubcomponent, _sleepInContext, _subcomponentForElementWithID, _templateNameForClass, _unroll, application, baseURL, bindingKeys, canAccessFieldsDirectly, canGetValueForBinding, canSetValueForBinding, clone, context, debugString, descriptionForResponse, ensureAwakeInContext, frameworkName, generateResponse, handleQueryWithUnboundKey, handleTakeValueForUnboundKey, hasBinding, hasSession, isCachingEnabled, isEventLoggingEnabled, logString, name, pageWithName, parent, path, pathURL, performParentAction, pullValuesFromParent, pushValuesToParent, session, set_componentUnroll, set_unroll, setCachingEnabled, setValueForBinding, setVariableValueForName, sleep, synchronizesVariablesWithBindings, takeValueForKey, takeValueForKeyPath, takeValuesFromRequest, template, templateWithHTMLString, templateWithHTMLString, templateWithHTMLString, templateWithName, toString, unableToSetNullForKey, validateTakeValueForKeyPath, validateValueForKey, valueForBinding, valueForBooleanBinding, valueForIntegerBinding, valueForKey, valueForKeyPath, valueForNSArrayBindings, valueForNSDictionaryBindings, valueForNumberBinding, valueForStringBinding, variableValueForName, variableWithName
public AjaxDatePicker(WOContext context)
public boolean isStateless()
isStateless
in class WOComponent
true
public void awake()
awake
in class WOComponent
public void reset()
reset
in class WOComponent
public Locale locale()
public Integer startDay()
public String otherTagString()
public void appendToResponse(WOResponse res, WOContext ctx)
appendToResponse
in class AjaxComponent
res
- the HTTP response that an application returns to a
Web server to complete a cycle of the request-response loopctx
- context of a transactionpublic String onFocusScript()
public String onClickScript()
public String showCalendarScript()
public String translateSimpleDateFormatSymbols(String symbols)
symbols
- the date format symbols to translatepublic String format()
public Format formatter()
public NSMutableDictionary options()
protected void addRequiredWebResources(WOResponse response)
addRequiredWebResources
in class AjaxComponent
response
- the response to write topublic WOActionResults handleRequest(WORequest request, WOContext context)
handleRequest
in interface IAjaxElement
handleRequest
in class AjaxComponent
request
- the requestcontext
- the contextpublic void validationFailedWithException(Throwable t, Object value, String keyPath)
validationFailedWithException
in class WOComponent
t
- the exception thrown during validationvalue
- the given value to be validatedkeyPath
- the key path associated with this value, identifies the property of an objectprotected String cssFileName()
protected String cssFileFrameworkName()
Copyright © 2002 – 2024 Project Wonder.