且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Primefaces日历 - 使用EL禁用特定日期

更新时间:2023-01-27 17:44:24

一种可能性就是转换bean中的值( [5-15-2013​​,6-23-2013​​] ),并将其直接放在Javascript代码中:

One possibility is just converting the value in a bean (["5-15-2013", "6-23-2013"]), and put it directly in the Javascript code:

var disabledDays = #{myBean.disabledDays};

这不是最干净的,但最简单的。另一种可能性就是在bean中使用字符串列表并使用< ui:repeat> 将其打印为逗号分隔列表。

It's not the cleanest one, but the easiest. Another possibility is just having the list of strings in the bean and use <ui:repeat> to print it as a comma separated list.