CalendarTextField Unparseable date

120 views
Skip to first unread message

Javier Godino

unread,
Apr 25, 2013, 3:36:12 PM4/25/13
to jfxtra...@googlegroups.com
Hello:

I have a ParseException after entered an invalid date in the Calendar Text Field:

java.text.ParseException: Unparseable date: "45"
at java.text.DateFormat.parse(DateFormat.java:357)
at jfxtras.labs.internal.scene.control.skin.CalendarTextFieldCaspianSkin.parse(CalendarTextFieldCaspianSkin.java:290)
at jfxtras.labs.internal.scene.control.skin.CalendarTextFieldCaspianSkin.access$200(CalendarTextFieldCaspianSkin.java:64)
at jfxtras.labs.internal.scene.control.skin.CalendarTextFieldCaspianSkin$2.invalidated(CalendarTextFieldCaspianSkin.java:128)
at com.sun.javafx.binding.ExpressionHelper$Generic.fireValueChangedEvent(ExpressionHelper.java:359)

I cannot take control before parse.

I added a listener:

calTextField.valueProperty().addListener(new ChangeListener<Calendar>() .....

and I cannot catch the value before parse.

Could someone help me?

Thanks in advance!!!

Javier




Tom

unread,
Apr 25, 2013, 4:38:55 PM4/25/13
to jfxtra...@googlegroups.com
I'll take a peek this weekend.
--
You received this message because you are subscribed to the Google Groups "JFXtras Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jfxtras-user...@googlegroups.com.
To post to this group, send email to jfxtra...@googlegroups.com.
Visit this group at http://groups.google.com/group/jfxtras-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Tom

unread,
Apr 27, 2013, 2:34:05 AM4/27/13
to jfxtra...@googlegroups.com
You are quite right, I found a "TODO" in there that I had to handle this situation. The idea was to show a popup, but with Gerrit's validation layer maybe that is a nicer approach. But in the end it is practical that the user can influence it. So I've added a "parseErrorCallback" property and if that is set, the handling is up to you. It's the idea to provide a default implementation, but that is now the TODO :-)

When the callback is triggered, the control will have refreshed the contents already.

New snapshot is published.

Tom


On 2013-04-25 21:36, Javier Godino wrote:

Javier Godino

unread,
Apr 30, 2013, 9:32:56 AM4/30/13
to jfxtra...@googlegroups.com
Hi Tom:
Excellent solution!!!.
I changed my code and its works perfectly.
Thanks!!!
Javier
Reply all
Reply to author
Forward
0 new messages