Re: Ajaxautocomplete to one relationship
Re: Ajaxautocomplete to one relationship
- Subject: Re: Ajaxautocomplete to one relationship
- From: David LeBer <email@hidden>
- Date: Tue, 29 Sep 2009 15:42:48 -0400
On 2009-09-29, at 3:07 PM, Mark Wardle wrote:
Hi all.
I'm successfully using ajaxautocomplete but that results in a string.
Fine for subsequent searching. Is there a unified component that will
handle setting a to one relationship with a drop down populated by
autocomplete?
Otherwise I'll see whether I can roll my own!
We have one, unfortunately it's implementation is pretty specific for
the project it's used in and not really suitable for sharing:
1. It is D2W and tuned for our look.
2. It makes assumptions about the model (yes, I know, that is bad).
The issue with using a autocomplete to do a lookup for a to-one
relationship is that, as you mention, the autocomplete returns a
string. You need to then guarantee that the attribute you are
qualifying the found EO against is unique. For some EOs this is a non
issue (qualifying countryName in the array of Country EOs). For EOs
where this is not the case (productName in the array of Product EOs)
we achieve this by appending a guaranteed unique value (i.e:
productCode) to the the primary search attribute.
;david
--
David LeBer
Codeferous Software
'co-def-er-ous' adj. Literally 'code-bearing'
site: http://codeferous.com
blog: http://davidleber.net
profile: http://www.linkedin.com/in/davidleber
twitter: http://twitter.com/rebeld
--
Toronto Area Cocoa / WebObjects developers group:
http://tacow.org
_______________________________________________
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