当前位置: 代码迷 >> Web前端 >> datetimepicker不能展示
  详细解决方案

datetimepicker不能展示

热度:110   发布时间:2012-08-03 00:12:14.0
datetimepicker不能显示
struts2.1.6
在以前的struts2版本中s:datetimepicker只需要在head标签处设置
<s:head theme="ajax"/>,
就可以直接使用s:datetimepicker的标签了。
而在2.1.6版本中不能直接这样使用了,将datetimepicker移除了。
原因是此标签调用了dojo的datetimepicker的库。
所以现在使用的时候首先要导入一个库。


struts2-dojo-plugin-2.1.6.jar。

然后还要设置dojo的taglib





Java代码
<%@ taglib prefix="sd" uri="/struts-dojo-tags" %>  
<%@ taglib prefix="sd" uri="/struts-dojo-tags" %> 同样也需要对theme进行设置



Java代码
<s:head theme="xhtml"/>   
<sd:head parseContent="true"/> 
<s:head theme="xhtml"/> <sd:head parseContent="true"/>上面的设置在head标签中。
然后使用sd:datetimepocker就可以实现了。