Having trouble with fetching on date
Having trouble with fetching on date
- Subject: Having trouble with fetching on date
- From: Reid Bundonis <email@hidden>
- Date: Thu, 11 Sep 2003 20:59:28 -0400
WOListers,
This seems like it should be simple enough, but I am having a tough
time. I have a simple search form that has one WOTextField bound to a
String, searchValue. I've also set the date format binding of the
WOTextField to %m/%d/%y since I want the values entered into it to be
in date format since I am searching for a date.
Next, I built my fetch which I know functions as I replaced the
recordDate search attribute with something else in the table and I got
the desired results. However, when trying to fetch on an entered date,
I am getting all sorts of exceptions.
The fetch is simply:
NSArray binding = new ... searchValue;
qual = ("recordDate = %@", binding;
fs = ("ArticleRecord", qual, null)
displayList = mutableArray of objects from fs
When I drop a date into the field, I get "While trying to set the
field "searchValue" on an object of type Main we expected a
java.lang.String but recieved a com.webobjects.foundation.NSTimestamp
with a value of "month/day/year I entered". This often happens if you
forget to use a formatter."
But aren't I using a formatter when I set the WOTextField with the date
formatter binding? How else do I tell the WOTextField to be and
NSTimestamp field?
I looked at the NSTimestampFormatter, but I started getting confused.
I am pretty sure I am missing something rather simple, but I can't
quite put my finger on it. I also tried building a fetch spec in
EOModeler, but I was getting even stranger results.
If anyone can explain the fine points of fetching by date, I would be
very grateful.
Reid
_______________________________________________
webobjects-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/webobjects-dev
Do not post admin requests to the list. They will be ignored.