Bindings, searchfield, how to use predicate to search related database
Bindings, searchfield, how to use predicate to search related database
- Subject: Bindings, searchfield, how to use predicate to search related database
- From: Alexander Reichstadt <email@hidden>
- Date: Fri, 5 May 2006 16:38:54 +0200
Hi,
Is there a way to use the predicate field in IB to also query fields
of a related database?
I have two array controllers named departments and employees. The
departments controller has an attribute called name. The employees an
attribute called lastname.
Using IB's inspector's binding page (select UI object, hit cmd-4), a
predicate is bound to the departments controller, and its predicate
format field set to "name contains[c] $value".
In the UI there are two tableviews, One lists all departments, and
depending on the selection in that table the other table view lists
all reporting employees. When the user enters a value the table
hooked up to the departments controller displays all the departments
whose name contains what was entered. But I would like to extend that
so that also the related employees last name is queried through the
departments controller. A to-many relationship references the
reporting employees, but somehow I can't figure out how to use it
using IB's predicates binding page. I also have a fetch-request in
place programmatically, but I would prefer to use something like the
following in IB if that's possible:
(name contains[c] $value) OR (reportingEmployees.lastname contains[c]
$value)
I see that my error must somehow lie in the fact that
reportingEmployees returns an array of objects, so that I think there
should be something between the reportingEmployees phrase and the
lastname: reportingEmployees.<somethingmissing>.lastname contains[c]
$value. Or is this not an option at all?
I'd be thankful for any input.
Thanks in advance.
Alex
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden