• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

question on datetime converter and validation of a datetime field

 
Melinda Savoy
Ranch Hand
Posts: 387
Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • 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.

 
Abzee AntiPro
Greenhorn
Posts: 14
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • 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
  • 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
  • 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
  • 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
  • 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
  • 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
  • Quote
  • Report post to moderator
thanks to you as well
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic