如何在 Richfaces 中集成时间选择器并将其绑定到 jsf 托管 bean
您能否解释一下如何将时间选择器组件集成到我的JSF/Richfaces Web应用程序中,并将其将其值绑定到托管bean?
我知道 rich:calendar 组件带有日期和时间选择器,但我只需要后者。特别是,我需要向用户提供一个时间选择器,以便他/她可以选择 FROM 时间和 TO 时间,它们都仅限于从 bean 读取的特定最小/最大值。
我可能可以使用 js/jquery 小部件,它们是相应的 richfaces 组件,但我不明白如何正确使用它们并将它们绑定到 bean。非常感谢。
Could you please explain me how to integrate a time picker component into my JSF/Richfaces web app, and bind its value to a managed bean?
I know the rich:calendar component comes out with both a date and a time pickers, but I need the latter only. In particular I need to provide a time selector to the user, so that he/she can select a FROM time and a TO time, where they are both limited to specific min/max values read from the bean.
I can probably use js/jquery widgets with they're corresponding richfaces components, but I didn't understand how to properly use them and bind them to the bean. Thank you very much.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
rich:calendar 用于选择日期,其时间选择器是可选的,我认为你应该自己编写它,只需放置两个 rich:inputNumberSpinner 来表示小时和分钟。
在MyBean类中定义两个整数属性,小时和分钟;然后为它们添加 getter 和 setter。
rich:calendar is for choosing date and its time picker is optional, I think you should write it yourself, just put two rich:inputNumberSpinner for hours and minutes.
In MyBean class define two integer properties, hours and minutes; then add getters and setters for them.
这是我的带有客户端验证的开始和结束时间选择器的代码,希望它有所帮助。
timePicker.xhtml :
和 resources/js/timeValidator.js :
Here is my code for start and end time pickers with client side validation, hope it helps.
timePicker.xhtml :
and resources/js/timeValidator.js :