p:日历多日期选择 [英] p:calender multiple date selection
问题描述
我正在尝试使用p:calender(primefaces 3.3)实现多种日期选择功能, 这样.
I am trying to achieve multiple selection of dates functionality with p:calender(primefaces 3.3), in this way.
<p:calendar id="cal" showButtonPanel="true" mode="inline"
value="#{bean.dates}" selection="multiple"/>
在Backing bean中,我以这种方式将日期作为数组:
In Backing bean I have taken dates as a array in this way:
private Date[] dates;
public Date[] getDates() {
return dates;
}
public void setDates(Date[] dates) {
this.dates = dates;
}
但是仍然无法选择多个日期.
But still didnt able to select multiple dates.
根据此博客 http://blog.primefaces.org/?p=391可以.
我试图以相同的方式实现.但是没有奏效. 为什么会这样呢?
I tried to implement in same way .but did'nt worked. Why is it so?
推荐答案
您阅读的Blog帖子已经过时了,那时,primefaces的日历依赖于YUI,而现在它基于Jquery UI datepicker(不支持多选)
The Blog post you have read is very outdated , in that time the calendar of primefaces was relying in YUI , while now its based on Jquery UI datepicker (which does not support the multi selection)
因此,您无法使用primefaces当前日历实现多个日期选择,但是您可以使用Google一点点并找到其他基于jquery的替代方法,
SO you can't achieve multiple date selection with primefaces current calendar , but you can Google a bit and find other jquery based alternatives,
例如 jQuery UI Datepicker-多个日期选择
这篇关于p:日历多日期选择的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!