转自酷猫
<h:form>
<h:outputLabel value="选取时间" />
<h:panelGroup>
<rich:calendar id="selectTime" popup="true" locale="cn" value="#{myBean.selectTime}" cellWidth="30px" cellHeight="30px" datePattern="yyyy-MM-dd HH:mm" required="true" requiredMessage="必须填写开单时间" />
</ h:message for="selectTime " style="color:red" >
</h:panelGroup>
</h:form>
最后在我们的messages_cn.properties文件添加以下key,value可以实现国际化
RICH_CALENDAR_TODAY_LABEL=今天
RICH_CALENDAR_CLOSE_LABEL=关闭
RICH_CALENDAR_OK_LABEL=确定
RICH_CALENDAR_CLEAN_LABEL=清空
RICH_CALENDAR_CANCEL_LABEL=取消
本文介绍如何在JSF应用中使用RichFaces组件库的日期选择器,并展示了如何配置日期选择器的样式、格式及国际化设置等。
21

被折叠的 条评论
为什么被折叠?



