| java.lang.Object com.opensymphony.webwork.components.Component com.opensymphony.webwork.components.UIBean com.opensymphony.webwork.components.TextField com.opensymphony.webwork.components.DatePicker
DatePicker | public class DatePicker extends TextField (Code) | |
Renders datepicker element.
Implementation was changed in WebWork 2.2 to use jscalendar
instead of non locale aware tigracalendar. Check locale and format settings if you used the old widget in your
applications. Be sure to include proper stylesheet as described below if you don't want the calender widget to look
transparent.
Important: Be sure to set the id attributs if not used within a <ww:form /> tag, as it takes care of
setting the id for you, being required to copy selected date to text input element.
Following a reference for the format parameter (copied from jscalendar documentation):
|
%a | abbreviated weekday name |
%A | full weekday name |
%b | abbreviated month name |
%B | full month name |
%C | century number |
%d | the day of the month ( 00 .. 31 ) |
%e | the day of the month ( 0 .. 31 ) |
%H | hour ( 00 .. 23 ) |
%I | hour ( 01 .. 12 ) |
%j | day of the year ( 000 .. 366 ) |
%k | hour ( 0 .. 23 ) |
%l | hour ( 1 .. 12 ) |
%m | month ( 01 .. 12 ) |
%M | minute ( 00 .. 59 ) |
%n | a newline character |
%p | ``PM'' or ``AM'' |
%P | ``pm'' or ``am'' |
%S | second ( 00 .. 59 ) |
%s | number of seconds since Epoch (since Jan 01 1970 00:00:00 UTC) |
%t | a tab character |
%U, %W, %V | the week number |
%u | the day of the week ( 1 .. 7, 1 = MON ) |
%w | the day of the week ( 0 .. 6, 0 = SUN ) |
%y | year without the century ( 00 .. 99 ) |
%Y | year including the century ( ex. 1979 ) |
%% | a literal % character
|
Examples
Date in application's locale format:
<ww:datepicker name="order.date" id="order.date" />
Date in german locale, with german texts:
<ww:datepicker name="delivery.date" id="delivery.date" template="datepicker_js.ftl" language="de" />
Date in german locale, with german texts and custom date format, including time:
<ww:datepicker name="invoice.date" id="invoice.date" template="datepicker_js.ftl" language="de" format="%d. %b &Y %H:%M" showstime="true" />
If you use this jscalendar based datepicker widget, you might want to use one of the standard stylesheets provided
with jscalendar (all distribution stylesheets are included in webwork jar). The easiest way to do so is to place the
<ww:head/> tag in the head of your html page, as it takes care of including calendar css.
Otherwise, to manually activate the calendar-blue style, include the following in your stylesheet definition:
<link href="<ww:url value="/webwork/jscalendar/calendar-blue.css" />" rel="stylesheet" type="text/css" media="all"/>
author: Patrick Lightbody author: Rene Gielen version: $Revision: 2541 $ since: 2.2 |
evaluateParams | public void evaluateParams()(Code) | | |
getDefaultTemplate | protected String getDefaultTemplate()(Code) | | |
setFormat | public void setFormat(String format)(Code) | | The format to use for date field.
|
setLanguage | public void setLanguage(String language)(Code) | | The language to use for the widget texts and localization presets.
|
setShowstime | public void setShowstime(String showstime)(Code) | | Whether time selector is to be shown. Valid values are "true", "false", "24" and "12".
|
setSingleclick | public void setSingleclick(String singleclick)(Code) | | Whether to use selected value after single or double click.
|
Methods inherited from com.opensymphony.webwork.components.Component | public void addAllParameters(Map params)(Code)(Java Doc) public void addParameter(String key, Object value)(Code)(Java Doc) public boolean altSyntax()(Code)(Java Doc) public void copyParams(Map params)(Code)(Java Doc) protected String determineActionURL(String action, String namespace, String method, HttpServletRequest req, HttpServletResponse res, Map parameters, String scheme, boolean includeContext, boolean encodeResult, boolean escapeXml)(Code)(Java Doc) protected String determineNamespace(String namespace, OgnlValueStack stack, HttpServletRequest req)(Code)(Java Doc) public boolean end(Writer writer, String body)(Code)(Java Doc) protected boolean end(Writer writer, String body, boolean popComponentStack)(Code)(Java Doc) protected WebWorkException fieldError(String field, String errorMsg, Exception e)(Code)(Java Doc) protected Component findAncestor(Class clazz)(Code)(Java Doc) protected String findString(String expr)(Code)(Java Doc) protected String findString(String expr, String field, String errorMsg)(Code)(Java Doc) protected Object findValue(String expr)(Code)(Java Doc) protected Object findValue(String expr, String field, String errorMsg)(Code)(Java Doc) protected Object findValue(String expr, Class toType)(Code)(Java Doc) public Stack getComponentStack()(Code)(Java Doc) public String getId()(Code)(Java Doc) public Map getParameters()(Code)(Java Doc) public OgnlValueStack getStack()(Code)(Java Doc) protected void popComponentStack()(Code)(Java Doc) public void setId(String id)(Code)(Java Doc) public boolean start(Writer writer)(Code)(Java Doc) protected String toString(Throwable t)(Code)(Java Doc) public boolean usesBody()(Code)(Java Doc)
|
|
|