• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Tim Cooke
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Devaka Cooray
  • Ron McLeod
  • paul wheaton
Saloon Keepers:
  • Tim Moores
  • Piet Souris
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Frits Walraven
  • Scott Selikoff

question on datetime converter and validation of a datetime field

 
Ranch Hand
Posts: 387
Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have a datetime field defined in my JSP page as:



When I am validating this field and the page is redisplayed it shows the following after I entered the value 04/11/2010 in this field and clicked SUBMIT again:

{0}: Conversion error occurred.

My validation code is as follows for this field:



Can someone please tell me what I'm doing wrong here? Any help/direction would be appreciated.

Thanks.

 
Greenhorn
Posts: 14
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hey, try using "dd/MM/yyyy".
java is case sensitive and sometimes causes issue with case.

also, why do you want the user to input dates manually.
give a small calendar next to the input box and let the user click and decide the date from the pop-up-calendar.

dont make the input text editable so you dont have to write a converter for it.

Regards,
 
Melinda Savoy
Ranch Hand
Posts: 387
Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Abid for the quick reply. Can you give me any direction on what calendar I can use here?

Thanks again.
 
Abzee AntiPro
Greenhorn
Posts: 14
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
There are hundreds of script written for using a pop-up calendar.

here is one such site.

http://www.softcomplex.com/products/tigra_calendar/

i m attaching the script for your reference.

Thanks,
Abid

PS: open the attachment in a zip file.
It looks like a image file but its a zip archive
tigra_calendar.jpg
[Thumbnail for tigra_calendar.jpg]
 
Melinda Savoy
Ranch Hand
Posts: 387
Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you so much. Appreciate all the help.
 
Melinda Savoy
Ranch Hand
Posts: 387
Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
After finally getting the JS calendar setup on my form I selected a date from the calendar and then I got this error on my page:


Conversion Error setting value '08/23/2010' for 'null Converter'.


I may have misunderstood the post above but I thought I would not have to write a converter for this.

I then tried changing up my code in the JSP page to include the converter dateTime as follows:



And now I get this error in my web page:


ARTransferForm:fromServiceDate: '08/23/2010' could not be understood as a date.


Thanks again in advance for the help or direction on my problem. Regards.
 
Melinda Savoy
Ranch Hand
Posts: 387
Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Sorry I got my problem resolved. It was the pattern I had defined.

Thanks anyway. Regards.
 
Abzee AntiPro
Greenhorn
Posts: 14
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
thanks to you as well
 
Your buns are mine! But you can have this tiny ad:
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic