I have Student modal class where two utils date objects are there and form field related to this are not mandatory, so whenever I don't enter any value in form date picker its throwing binding exception at base controller as we cant set '' to Date object
I am not able to set null from JavaScript to date form field explicitly if its value is blank.
There are two solution to this problem but I am searching for the good one and not the 'JUGAAD'
Solution 1: if form field is blank set value as '1000-10-10'or something like this in javascript before submitting the form , so that it wont try to set empty string to date object and binding exception wont come
Solution 2: Create string instance variable in modal class and store form value to this string object first and later at Dao level we can check the value whether its blank or any Date and then set Date instance variable accordingly.
is there any other better solution than this