The beauty of a date(time) formatted field

Find out how to get things done with Servoy. Post how YOU get things done with Servoy

The beauty of a date(time) formatted field

Postby IT2Be » Wed Apr 14, 2004 10:20 am

It took me some months to find this. And I only found it by accident so I can imagine there are a lot of you out there that don't know this:

When you have a field, based on a datetime dataprovider there is a beautiful aspect of it.

Normally you would format a date field like 'dd-MM-yyyy', 'MM/dd/yyyy', 'ddMMyy' or whatever you want.

Now set the field to selectOnEnter and all content will be selected when you place the cursor in the field. So far nothing fancy!

Now click your <up> or <down> cursor and hey... The first (in my case day) value/portion of the field goes up and down. Great isn't it? It works like a charm, respecting the complete calendar...

Now click your (<left> or) <right> cursor and again wow... You can now step up and down through the month or year value...

Also double clicking on one portion of the field selects only that specific portion (day, month or year)...

I just couldn't resist to share this one with you.

BTW you don't have to make the field a calendar field just make it a text field and voila. This might be part of a solution to those that don't like the standard Java calendar. For me that one is too ugly to work with, especially on mac.
Marcel J.G. Trapman (IT2BE)
SAN partner - Freelance Java and Servoy
Servoy Components - IT2BE Plug-ins and Beans for Servoy
ServoyForge - Open Source Components for Servoy
User avatar
IT2Be
Servoy Expert
 
Posts: 4766
Joined: Tue Oct 14, 2003 7:09 pm
Location: Germany

Re: The beauty of a date(time) formatted field

Postby Riccardino » Wed Apr 14, 2004 3:13 pm

IT2BE wrote:BTW you don't have to make the field a calendar field just make it a text field and voila. This might be part of a solution to those that don't like the standard Java calendar. For me that one is too ugly to work with, especially on mac.


Great tip. And it also works with calendar formatted field, so you can have both active at the same time...
User avatar
Riccardino
 
Posts: 911
Joined: Thu Apr 24, 2003 11:42 am
Location: Ferrara, Italy

Re: The beauty of a date(time) formatted field

Postby mattman » Fri Apr 16, 2004 6:52 pm

IT2BE wrote:I just couldn't resist to share this one with you.


Yes, very cool. Now the question is... Can we get the developers to watch for the tab key if the previous event was a double-click on the first value.

This would allow you to tab to the individual date parts WITHIN the field. This would prevent you from having to use the mouse.
Matt Petrowsky
mattman
 
Posts: 160
Joined: Wed Aug 06, 2003 8:23 am
Location: Murrieta, CA

Postby IT2Be » Fri Apr 16, 2004 8:47 pm

Yes, that would be great. But if this can be done I would like it to be taken to the level of a keydown and mousedown event...

BTW you can step through with the right (not left) cursor. Once a value is selected you automatically go to the beginning of the next value. Clicking up and down again selects the complete (newly selected) value again...
Marcel J.G. Trapman (IT2BE)
SAN partner - Freelance Java and Servoy
Servoy Components - IT2BE Plug-ins and Beans for Servoy
ServoyForge - Open Source Components for Servoy
User avatar
IT2Be
Servoy Expert
 
Posts: 4766
Joined: Tue Oct 14, 2003 7:09 pm
Location: Germany


Return to How To

Who is online

Users browsing this forum: No registered users and 5 guests