[Catalyst] HTML::Prototype - extra context in the search
Andreas Marienborg
omega at palle.net
Tue Nov 15 17:38:10 CET 2005
On 15. nov. 2005, at 15.53, Chisel Wright wrote:
> Hi all,
>
> I'm having some success with HTML::Prototype in my CatApp.
>
> I have a sub that does:
>
> my $complete_campaign = $c->req->params->{complete_campaign};
> $campaign_class->search(
> name => {
> 'ilike', "%${complete_campaign}%",
> },
> );
>
> I'd like to be able to refine the search by using information from the
> page/stash, something like:
>
> client_id => $c->stash->{current_client}->id()
>
>
> The thing is I'm not sure how to pass this information through to the
> autocomplete function.
>
> Ideally I'd use $c somehow, as I'd prefer not to read the client_id
> from
> a value passed in from the web-page/javascript.
>
> Any pointers, or examples I can look at?
>
that depends on what populates your $c. If it is populated correctly
on ajax-requests, you should be able to just use $c where you build
your return value for the ajax-request.
if you use the helpers, I'm not sure where you would pass it in, or
how they could be expected to use it.
andreas
More information about the Catalyst
mailing list