Closed clempinch closed 12 years ago
Hello,
Yes, I just forgot the definition of onConfigure(JQueryBehavior behavior), which allows to set the widget options. I will add it shorty.
Thanks and best regards, Sebastien.
Hi,
I added the method mentioned above, the usage to specify the minimum string-length before querying the server is:
form.add(new AutoCompleteTextField<String>("autocomplete", new Model<String>()) {
private static final long serialVersionUID = 1L;
@Override
protected void onConfigure(JQueryBehavior behavior)
{
super.onConfigure(behavior);
behavior.setOption("minLength", 3);
}
}
Please note that, by providing this method, you are also able to define the delay the widget waits before querying the server (option delay
). As this overlaps with the AjaxCallThrottlingDecorator
(previously sets to one second), I removed it, and let the default widget delay (300ms).
I will publish a note in the next release/changelog about this.
Thanks & best regards, Sebastien.
Thanks a lot. Seems simple to use :-) I will test it at the next release. Regards,
Clement
Hello, I am using the AutoCompleteTextField component, but I would like the component to start the getChoices() method after a certain number of characters entered in the text field (because I would like to avoid calls retrieving long list from the database). I guess it should be an enhancement on your side. Is it possible to have it?