Struts日历选择框 标签<sx:datetimepicker.../>详解
来源:互联网 发布:淘宝优站从哪里进去 编辑:程序博客网 时间:2024/05/21 06:35
先导入struts2-dojo-plugin-2.1.6.jar,再在jsp页面最开头加上:
<%@ taglib prefix="sx" uri="/struts-dojo-tags" %>
在<head> </head>中加入<sx:head />
下面的代码直接就实现了日历选择框:
[html]
<sx:datetimepicker label="日历" name="calendar" value="today"
toggleType="plain" toggleDuration="300" language="zh_CN" type="date"
displayWeeks="5" displayFormat="dd/MM/yyyy" formatLength="long" />
Parameters:
(注:toggle['tɒg(ə)l]触发)
最后的效果如下图:
value属性的写法还有:
<sx:datetimepicker value="%{date}"/>
<sx:datetimepicker value="%{'2007-01-01'}"/>
<sx:datetimepicker value="%{'today'}"/>
datetimepicker标签解析:
Description:
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.
参数displayFormat的所有可能取值:
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 following formats(in order) will be used to parse the values of the attributes 'value', 'startDate' and 'endDate':
SimpleDateFormat built using RFC 3339 (yyyy-MM-dd'T'HH:mm:ss)
SimpleDateFormat.getTimeInstance(DateFormat.SHORT)
SimpleDateFormat.getDateInstance(DateFormat.SHORT)
SimpleDateFormat.getDateInstance(DateFormat.MEDIUM)
SimpleDateFormat.getDateInstance(DateFormat.FULL)
SimpleDateFormat.getDateInstance(DateFormat.LONG)
SimpleDateFormat built using the value of the 'displayFormat' attribute(if any)
0 0
- Struts日历选择框 标签<sx:datetimepicker.../>详解
- Struts2 日历选择框 标签<sx:datetimepicker.../>详解
- struts 2.1.8.1的sx:datetimepicker标签出现NaN错误的原因和解决办法
- struts 2.1.8.1的sx:datetimepicker标签出现NaN错误的原因和解决办法
- 关于Struts 标签:datetimepicker
- struts2标签sx:datetimepicker报错异常的解决方法
- Struts2 如何用JS获取sx:datetimepicker选择的日期
- sx:datetimepicker的使用
- sx:datetimepicker 无法显示
- struts-dojo-tags datetimepicker标签
- 如何在struts2中使用、配置ajax,json?sx:datetimepicker无法显示日历
- struts2.1 sx datetimepicker 乱码
- sx:datetimepicker错误、不显示
- 关于struts2中sx:datetimepicker标签月份正常显示的解决方法
- Struts dojo datetimepicker 标签中文乱码
- javascript 获取 <sx:datetimepicker> 的值
- javascript 获取 sx:datetimepicker 的值
- 如何让Struts 2 的 datetimepicker 标签的输入框不可输入
- Undefined symbols for architecture i386;
- Android 开源的真相: 无法fork
- java 学习笔记 随机数产生的两种办法Math.random()和Random类
- 移动计算最新科研成果评述
- 关联映射-单向Set-based关联
- Struts日历选择框 标签<sx:datetimepicker.../>详解
- C++11 并发指南二(std::thread 详解)
- JS方式简单显示用户IP与地区来源
- Spring中配置事务的几种方式
- SVM分类器-LS-SVM(二)
- 【数据结构】 约瑟夫回环 代码
- c# sha-1和base64加密方法实现
- 使用ZeroClipboard解决跨浏览器复制到剪贴板的问题
- 网易游戏开发岗实习面试(十年广州求学路以及一个菜鸟半年多的成长之路)