Re: More newbie questions
Re: More newbie questions
- Subject: Re: More newbie questions
- From: Randy Becker <email@hidden>
- Date: Tue, 15 Nov 2005 18:48:47 -0500
On Nov 15, 2005, at 6:21 PM, Sacha Michel Mallais wrote:
On Nov 15, 2005, at 2:46 PM, Randy Becker wrote:
Firstly, is there an EOUtilities function to return objects that
match multiple criteria? Or do I have to use lower level methods?
Yes, you're using it below: objectsWithQualifierFormat()...
Right now I've got:
String format = "title caseInsensitiveLike %s";
NSArray args = new NSArray(searchQuery);
return EOUtilities.objectsWithQualifierFormat( session
().defaultEditingContext(), "Item", format, args);
but I'd like to do something like
String format = "(title caseInsensitiveLike %s) OR (title
caseInsensitiveLike %s)";
That exact format string will work. The only difference is you'll
need to include a second argument for the second %s.
D'oh! :)
by the way, there must be a better way of doing this than the following:
NSMutableArray arguments = new NSMutableArray();
arguments.addObject(searchQueryWithWildcard);
arguments.addObject(searchQueryWithWildcard);
NSArray args = new NSArray(arguments);
Secondly, how can I display data from an object related to one
that is displayed in a WORepetition. Right now, I'm only able to
access the attributes of a particular object I'm outputting, and
the information I'd like to display is located in a related object.
Through the magic of Key Value Coding. If you have two objects a
and b, where a relates to b, and where both have a "name"
attribute, then all the following will work:
key path gives
----------------------------------------
a the object a
a.name a's name
a.name.length a's name's length
a.b the b that is related to a
a.b.name the name of the b that is related to a
Actually, the two objects I'm dealing with in particular do not have
the same attributes - I want to find the address of a person who owns
an item, but an item can be owned and posessed by different people,
thusly, I'm trying to do something like item.owner.address - but item
also is related to a person by the item.possessor attribute...
And finally, how can I do something like the WOExamples
WXCheckBoxList - I tried importing some of the frameworks in the
examples project, but couldn't get it to work - what I want to do
is present a list of checkboxes with a single submit button that
will perform an action on all of the objects represented by the
selected boxes.
Hmm, probably easiest just to do this yourself in the submit action
method.
sacha
--
Sacha Michel Mallais 400 lb. chimp
Global Village Consulting Inc. http://www.global-village.net/
PGP Key ID: 7D757B65 AIM: smallais
Choke on that, causality! -- the Professor, "Futurama"
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden