Hallo Martin, 

the tickets I found do not include the thins I would need. 

Just to get your opinion on the way i am planning to do this. 

I want to add a a String to AutoCompleteSettings that allows to have a js 
-function called. That would allow me to alter the Attributes used for the Ajax 
Call. e.g. add additional parameters from the form 

A code snipplet to try to explain the idea. 

function actualUpdateChoices () { 
showIndicator (); 

var paramName = cfg . parameterName ; 
var attrs = { 
u : callbackUrl , 
pre : [ function ( attributes ) { 
var activeIsInitial = ( document . activeElement === initialElement ); 
var elementVal = Wicket . $ ( elementId ). value ; 
var hasMinimumLength = elementVal . length >= minInputLength ; 
var result = hasMinimumLength && activeIsInitial ; 
if ( ! result ) { 
hideAutoComplete (); 
} 
return result ; 
}], 
ep : {}, 
wr : false , 
dt : 'html' , 
sh : [ doUpdateChoices ] 
}; 
attrs . ep [ paramName ] = Wicket . $ ( elementId ). value ; 

call js function as defined by the Autocomplete Settings that uses the attrs 
variable as a parameter 

Wicket . Ajax . ajax ( attrs ); 
} 
If i get it to work I would provide a patch 

Thanks 

Jan 
----- Original Message -----

> From: "Martin Grigorov" <mgrigo...@apache.org>
> To: users@wicket.apache.org, "Jan Moxter" <jan.mox...@innobix.com>
> Sent: Thursday, March 20, 2014 9:24:50 AM
> Subject: Re: Additional Parameter fro AutoComplete

> Hi,

> This is not possible at the moment.
> You should either use a copy of wicket-autocomplete.js or
> monkey-patch it to override the methods that deal with the Ajax
> requests.
> There was a ticket with a patch about making this more friendly in
> Wicket 7.x but I cannot find it right now.

> Martin Grigorov
> Wicket Training and Consulting

> On Thu, Mar 20, 2014 at 3:27 PM, Jan Moxter < jan.mox...@innobix.com
> > wrote:

> > Hello Wicket,
> 

> > is there a way to send additional parameters from the UserInterface
> > for the ajax call on an AutoComplete.
> 

> > The reason for it is that in an form the User can use parameters as
> > a
> > filter for the AutoComplete and i do not want to make so much Ajax
> > Calls just to now what the User has selected. The filters do not
> > import for the model add all, just serve for usability.
> 

> > Up to now the only way i found to do this is alter the javascript.
> > for Autocomplete and replace it with a different one.
> 

> > Thanks
> 

> > Jan
> 

Reply via email to