[Catalyst] Re: CRUD, but with multiple tables involved

Brandon Black blblack at gmail.com
Sat Jan 7 05:01:04 CET 2006


On 1/6/06, Thomas Hartman <tphyahoo at gmail.com> wrote:
> Let's say the goal is to enter a dog with a breed.
>
> Seems to me what's really needed is a list-box. IE, a combination of
> drop-down (for breeds that have already been created) with the option
> of a textbox, for entering a new breed. Does something like this exist
> for html forms?
>
> If yes, and the user enters a new breed, you could also have a
> "verification" page where you say:
>
> 'entering this information will create a new breed "Shepherd." Are you
> sure you want to add this breed to the list of already existing
> breeds? Please double check that it doesn't already exist!'  -
> followed by a list of existing breeds.
>

One way to implement that would be with C::P::Prototype and using a
type-ahead search box ala Google Suggest (->auto_complete_field, etc).
 As they start typing a name, ajax calls will pull up existing matches
as they type for autocompletion, but they can still choose to type
something different instead.  If the word they ultimately choose is
not yet a key in the given table, then that triggers creation (with
warning/verification per above).  Another nice feature for the warning
would be to do some fuzzy matching against the existing keys (soundex
or something) to suggest existing close entries that the "new entry"
might be a typo for.

> I am having similar issues myself and so have been mulling this over.
> I am not sure if this combo listbox thing exists though. Would
> appreciate input on if this is a good/workable idea. And if it's
> workable if it can done with/without ajax.
>
> Don't really understand what the ajax functionality referred to
> earlier on was needed for. Explanation?
>

Aside from the typeahead idea above, the nice thing about using ajax
for something like this is that when/if someone enters a new key into
one of those fields, you can dynamically add another set of form
elements to the page for the details of the to-be-created referenced
entities.

-- Brandon



More information about the Catalyst mailing list