Hey
I use this auto-complete field as a searcher to fill my list view
I used the same class but I have a little problem with it ... I don't
understand where to call method findChoice() so I added behavior to this
search field like this:
this.autocompleteSearchField.add(
new AjaxFormComponentUpdatingBehavior("onchange") {
private static final long
serialVersionUID = 1L;
@Override
protected void onUpdate(AjaxRequestTarget
theTarget) {
Object obj =
autocompleteSearchField.findChoice();
if(obj == null) {
LOG.warn("Object is null!");
}
if( !(obj instanceof Bean) ){
LOG.warn("Object is not
subclass of a Bean! [{}]", obj.getClass());
return;
}
T bean = (T)obj;
if(selections.contains(bean)) return;
selections.add(bean);
theTarget.addComponent(listWrapper);
}
}
);
legend:
- Bean is my data object
- listWrapper is a wrapper that ListView in wrapped in
mind this row:
Object obj = autocompleteSearchField.findChoice();
how do you do it ?
Kind regards
Armando
--
View this message in context:
http://apache-wicket.1842946.n4.nabble.com/Form-model-update-with-ajax-using-AutoCompleteTextField-tp1872823p2313453.html
Sent from the Wicket - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]