public class DateTimePicker extends UIBean
Renders a date/time picker in a dropdown container.
A stand-alone DateTimePicker widget that makes it easy to select a date/time, or increment by week, month, and/or year.
It is possible to customize the user-visible formatting with either the 'formatLength' (long, short, medium or full) or 'displayFormat' attributes. By defaulty current locale will be used.
Syntax supported by 'displayFormat' is (http://www.unicode.org/reports/tr35/tr35-4.html#Date_Format_Patterns):-Format | Description |
d | Day of the month |
D | Day of year |
M | Month - Use one or two for the numerical month, three for the abbreviation, or four for the full name, or 5 for the narrow name. |
y | Year |
h | Hour [1-12]. |
H | Hour [0-23]. |
m | Minute. Use one or two for zero padding. |
s | Second. Use one or two for zero padding. |
The value sent to the server is a locale-independent value, in a hidden field as defined by the name attribute. The value will be formatted conforming to RFC3 339 (yyyy-MM-dd'T'HH:mm:ss)
The following formats(in order) will be used to parse the values of the attributes 'value', 'startDate' and 'endDate':
<sx:datetimepicker name="order.date" label="Order Date" /> <sx:datetimepicker name="delivery.date" label="Delivery Date" displayFormat="yyyy-MM-dd" /> <sx:datetimepicker name="delivery.date" label="Delivery Date" value="%{date}" /> <sx:datetimepicker name="delivery.date" label="Delivery Date" value="%{'2007-01-01'}" /> <sx:datetimepicker name="order.date" label="Order Date" value="%{'today'}"/><sx:datetimepicker id="picker" label="Order Date" /> <script type="text/javascript"> function setValue() { var picker = dojo.widget.byId("picker"); //string value picker.setValue('2007-01-01'); //Date value picker.setValue(new Date()); } function showValue() { var picker = dojo.widget.byId("picker"); //string value var stringValue = picker.getValue(); alert(stringValue); //date value var dateValue = picker.getDate(); alert(dateValue); } </script> <sx:datetimepicker id="picker" label="Order Date" valueNotifyTopics="/value"/> <script type="text/javascript"> dojo.event.topic.subscribe("/value", function(textEntered, date, widget){ alert('value changed'); //textEntered: String enetered in the textbox //date: JavaScript Date object with the value selected //widet: widget that published the topic }); </script>
Modifier and Type | Field and Description |
---|---|
protected String |
adjustWeeks |
protected String |
dayWidth |
protected String |
displayFormat |
protected String |
displayWeeks |
protected String |
endDate |
protected String |
formatLength |
protected String |
iconPath |
protected String |
language |
protected static com.opensymphony.xwork2.util.logging.Logger |
LOG |
protected String |
startDate |
protected String |
staticDisplay |
static String |
TEMPLATE |
protected String |
templateCssPath |
protected String |
toggleDuration |
protected String |
toggleType |
protected String |
type |
protected String |
valueNotifyTopics |
protected String |
weekStartsOn |
accesskey, cssClass, cssErrorClass, cssErrorStyle, cssStyle, defaultTemplateDir, defaultUITheme, disabled, dynamicAttributes, errorPosition, id, javascriptTooltip, key, label, labelPosition, labelSeparator, name, onblur, onchange, onclick, ondblclick, onfocus, onkeydown, onkeypress, onkeyup, onmousedown, onmousemove, onmouseout, onmouseover, onmouseup, onselect, request, requiredLabel, requiredPosition, response, tabindex, template, templateDir, templateEngineManager, templateSuffix, theme, title, tooltip, tooltipConfig, tooltipCssClass, tooltipDelay, tooltipIconPath, uiThemeExpansionToken, value
actionMapper, COMPONENT_STACK, devMode, parameters, stack, standardAttributesMap, throwExceptionOnELFailure
Constructor and Description |
---|
DateTimePicker(com.opensymphony.xwork2.util.ValueStack stack,
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response) |
Modifier and Type | Method and Description |
---|---|
void |
evaluateParams() |
protected String |
getDefaultTemplate() |
String |
getTheme() |
void |
setAdjustWeeks(String adjustWeeks) |
void |
setDayWidth(String dayWidth) |
void |
setDisplayFormat(String displayFormat) |
void |
setDisplayWeeks(String displayWeeks) |
void |
setEndDate(String endDate) |
void |
setFormatLength(String formatLength) |
void |
setIconPath(String iconPath) |
void |
setLanguage(String language) |
void |
setStartDate(String startDate) |
void |
setStaticDisplay(String staticDisplay) |
void |
setTemplateCssPath(String templateCssPath) |
void |
setTheme(String theme) |
void |
setToggleDuration(String toggleDuration) |
void |
setToggleType(String toggleType) |
void |
setType(String type) |
void |
setValue(String arg0) |
void |
setValueNotifyTopics(String valueNotifyTopics) |
void |
setWeekStartsOn(String weekStartsOn) |
addFormParameter, buildTemplateName, copyParams, enableAncestorFormCustomOnsubmit, end, ensureAttributeSafelyNotEscaped, escape, evaluateExtraParams, evaluateNameValue, getId, getTemplate, getTemplateDir, getTooltipConfig, getValueClassType, mergeTemplate, populateComponentHtmlId, setAccesskey, setClass, setCssClass, setCssErrorClass, setCssErrorStyle, setCssStyle, setDefaultTemplateDir, setDefaultUITheme, setDisabled, setDynamicAttributes, setErrorPosition, setId, setJavascriptTooltip, setKey, setLabel, setLabelposition, setLabelSeparator, setName, setOnblur, setOnchange, setOnclick, setOndblclick, setOnfocus, setOnkeydown, setOnkeypress, setOnkeyup, setOnmousedown, setOnmousemove, setOnmouseout, setOnmouseover, setOnmouseup, setOnselect, setRequiredLabel, setRequiredPosition, setStyle, setTabindex, setTemplate, setTemplateDir, setTemplateEngineManager, setTitle, setTooltip, setTooltipConfig, setTooltipCssClass, setTooltipDelay, setTooltipIconPath, setUIThemeExpansionToken
addAllParameters, addParameter, altSyntax, completeExpressionIfAltSyntax, determineActionURL, determineNamespace, end, fieldError, findAncestor, findString, findString, findStringIfAltSyntax, findValue, findValue, findValue, getComponentStack, getParameters, getStack, getStandardAttributes, isValidTagAttribute, popComponentStack, setActionMapper, setDevMode, setThrowExceptionsOnELFailure, setUrlHelper, start, stripExpressionIfAltSyntax, toString, usesBody
public static final String TEMPLATE
protected static final com.opensymphony.xwork2.util.logging.Logger LOG
protected String iconPath
protected String formatLength
protected String displayFormat
protected String toggleType
protected String toggleDuration
protected String type
protected String displayWeeks
protected String adjustWeeks
protected String startDate
protected String endDate
protected String weekStartsOn
protected String staticDisplay
protected String dayWidth
protected String language
protected String templateCssPath
protected String valueNotifyTopics
public DateTimePicker(com.opensymphony.xwork2.util.ValueStack stack, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
protected String getDefaultTemplate()
getDefaultTemplate
in class UIBean
public void evaluateParams()
evaluateParams
in class UIBean
public void setAdjustWeeks(String adjustWeeks)
public void setDayWidth(String dayWidth)
public void setDisplayWeeks(String displayWeeks)
public void setEndDate(String endDate)
public void setStartDate(String startDate)
public void setStaticDisplay(String staticDisplay)
public void setWeekStartsOn(String weekStartsOn)
public void setLanguage(String language)
public void setDisplayFormat(String displayFormat)
public void setFormatLength(String formatLength)
public void setIconPath(String iconPath)
public void setToggleDuration(String toggleDuration)
public void setType(String type)
public void setToggleType(String toggleType)
public void setTemplateCssPath(String templateCssPath)
public void setValueNotifyTopics(String valueNotifyTopics)
Copyright © 2000-2015 Apache Software Foundation. All Rights Reserved.