Now While searching . it is trying to save data and when unable to save data it is giving the following error .
Setting dataprovider with name ‘date_of_award’ / type ‘DATETIME’ with value of wrong type 29/06/2007 00:00:00…05/07/2007 23:59:59|dd/MM/yyyy HH:mm:ss
java.lang.IllegalArgumentException: Setting dataprovider with name ‘date_of_award’ / type ‘DATETIME’ with value of wrong type 29/06/2007 00:00:00…05/07/2007 23:59:59|dd/MM/yyyy HH:mm:ss
Please , let me know what is the error .
And , please suggest me is there any other way to search records within two given date range .
This date is a table field .
Hmm. Then I think this should work. Are you sure you really are in find mode? How does it look like if you step into this using the debugger? Do you see that you are in find mode then?
using this code it is working . but some time it is trying to save data and
error is coming
I am searching records with combination of two fields
please go through the following code that I am using
controller.find();
category = value .
// date field
date_of_post = formatToday + ’ 00:00:00…’ + formatLastDate + ’ 23:59:59|dd/MM/yyyy HH:mm:ss’;
controller.search();
Sometime it works fine. But sometime it tries to save the record
like the first search criteria
category value is changing (within search )
but while trying to save data ie … formatToday + ’ 00:00:00…’ + formatLastDate + ’ 23:59:59|dd/MM/yyyy HH:mm:ss’; to a date field it is giving error that I have already posted .
My objective is to filter data within two given date .
I don’t see anything wrong in your code. It just seems that in those occasions where you get the error, you are simply not in find mode. I can’t see when or how you call that method, but look out for that…
I spoke to Johan, about this and he adviced me to always check if you are in find-mode, because sometimes (when you use autoSave off, for example) a find, could fail.
so always do this:
if(controller.find() )
{
//do your find stuff here
}