简体   繁体   English

如何在JFXtras的LocalDatePicker中修复多个选择模式? (它在同一包中的CalendarPicker中工作)

[英]How can I fix multiple selection mode in LocalDatePicker in JFXtras? (it works in CalendarPicker in the same package)

I'm making a JavaFX program for which I would like to use the new Time API. 我正在制作一个JavaFX程序,我想为其使用新的Time API。 I wanted to use the LocalDatePicker provided in the JFXtras library which would allow users to select multiple localdate objects and would streamline the program's handling of selected objects (as opposed to the similar CalendarPicker in the same library which uses the older date API). 我想使用JFXtras库中提供的LocalDatePicker,它将允许用户选择多个localdate对象并简化程序对所选对象的处理(与使用较早日期API的同一库中的类似CalendarPicker相对)。

I imported the custom JFXtras controls into JavaFX scene builder, and while the "multiple" selection mode works very well for the JFXtras CalendarPicker control, the same functionality seems broken in the LocalDatePicker control. 我将自定义JFXtras控件导入到JavaFX场景构建器中,尽管“多个”选择模式对于JFXtras CalendarPicker控件非常有效,但是在LocalDatePicker控件中似乎破坏了相同的功能。

Multiple/Range selection does not work in either the preview feature of scene builder, in a compiled FXML/controller file generated in Netbeans, and when simply added to a JavaFX scene, while in all those cases the CalendarPicker control does work. 在场景构建器的预览功能中,在Netbeans中生成的已编译FXML /控制器文件中以及仅将其添加到JavaFX场景中时,多选/范围选择均无效,而在所有这些情况下,CalendarPicker控件均可以正常工作。 which leads me to believe it is a problem with the control itself and not my implementation. 这使我相信这是控件本身的问题,而不是我的实现问题。 I checked the respective classes in the library and the code handling modeProperty seems identical. 我检查了库中的各个类,并且代码处理modeProperty似乎相同。

Thing is, the sample program including all controls on the JFXtras page ( http://jfxtras.org/resources/java/jfxtras-labs-samples-8.0-r4-SNAPSHOT-shadow.jar ) has a multiple selection working for the LocalDatePicker control. 事实是,包括JFXtras页面( http://jfxtras.org/resources/java/jfxtras-labs-samples-8.0-r4-SNAPSHOT-shadow.jar )上的所有控件的示例程序具有适用于LocalDatePicker的多个选择控制。

What am I doing wrong? 我究竟做错了什么?

Sorry if it's an easy fix, I'm pretty new to Java (and JavaFX) 抱歉,如果修复起来很简单,我对Java(和JavaFX)还是很陌生

Thanks 谢谢

Oh yes. 哦是的 This was my fault. 这是我的错 Even though there was code to sync the mode value between LocalDatePicker and CalendarPicker, I forgot to set the initial value. 即使有代码在LocalDatePicker和CalendarPicker之间同步模式值,我也忘记设置初始值。 In the tests the value is set after the control is visible and then the sync code kicks in. Please try 8.0-r4-SNAPSHOT. 在测试中,该值在控件可见后设置,然后启动同步代码。请尝试8.0-r4-SNAPSHOT。 Thanks for reporting. 感谢您的举报。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM