[Catalyst] HTML::Prototype - extra context in the search

Andreas Marienborg omega at palle.net
Tue Nov 15 19:34:36 CET 2005


I was more along the lines of current_client beeing set in begin or  
somesuch, so that is would be there for the ajax-request.

You can also pass extra parameters by "fixing" the with parameter to  
the autocomplete field method:

[% with_string = "'pw1='+value+" _ "'&pw2='+document.getElementById 
('password2').value" %]
> [% c.prototype.auto_complete_field( 'complete_campaign', {
> url => url,
with => with_string
> } ) %]


or somesuch..

andreas

On 15. nov. 2005, at 17.51, Chisel Wright wrote:

> On Tue, Nov 15, 2005 at 05:38:10PM +0100, Andreas Marienborg wrote:
>> 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.
>
> I have "/campaign/list?client=4" which is handled by ::C::Campaign
> This sets $c->stash->{current_client} in auto()
>
> I'm using the Prototype plugin, so I have the following in my  
> template:
>
> ---- begin ----
> <input autocomplete="off" id="complete_campaign"
> name="complete_campaign" type="text" class="search_box" />
> <div class="auto_complete" id="complete_campaign_auto_complete"  
> style="text-align: left;"></div>
> [% url = base _ 'autocomplete/suggest_campaign' %]
> [% c.prototype.auto_complete_field( 'complete_campaign', {
> url => url } ) %]
> ---- begin ----
>
>
> I have ::C::AutoComplete with my complete_campaign() function.
> Adding an auto now, nothing 'useful' is passed in via
> $c->req->parameters() - no surprises there.
>
> So, what should be populating my $c?
>
> -- 
> Chisel Wright
> e: chisel at herlpacker.co.uk
> w: http://www.herlpacker.co.uk/
>
> No virus was found in this outgoing message as I didn't bother  
> looking.
>
> _______________________________________________
> Catalyst mailing list
> Catalyst at lists.rawmode.org
> http://lists.rawmode.org/mailman/listinfo/catalyst




More information about the Catalyst mailing list