Am using a custom controller with a number of global fields on it. One of those fields is a datetime field which is formated as MM/dd/yyyy and as a calendar field. Selecting a date in the field triggers a script which finds the matching dates. The method reads:
var arrivalDate = utils.dateFormat(globals.arrivalDate, ‘MM/dd/yyyy’)
controller.find()
{
indate = ‘#’ + arrivalDate + ‘|MM/dd/yyyy’;
}
controller.search()
Most of the time, this performs as expected however every so often I get the following error message:
Setting dataprovider with name ‘indate’ / type ‘DATETIME’ with value of wrong type #05/13/2004|MM/dd/yyyy
The date shown in the error message is the one that has been entered in the global field.
What is particularly strange about this scenario is that it doesn’t happen all the time and if I click Ok to the error message, it goes ahead and finds those records anyway.
Am also getting another strange method error which was also working perfectly. I enter part of a name in a global field and on exiting the field it finds all records that match. It is now perfoming the find correctly but almost immediately displays all of the records losing the found set.
var s = ‘#%’ + globals.searchName + ‘%’;
controller.find()
{
lastname = s;
}controller.search();
Any suggestions gratefully received. TIA