Is there a way to enable autocomplete for AjaxEditableLabel (just like
AutoCompleteTextField)? I was going through AutoCompleteTextField as a
reference and wrote my own behavior for autocompletion. The new behavior
works perfectly for a TextField, but not for AjaxEditableLabel.
Answering my own question (in case someone is looking for the same
functionality through a google search).
AjaxEditableLabel is a panel with a label and textfield component which
is why adding the autocomplete behavior to it didn't work. I solved it
by overriding the newEditor() method and adding my behavior to the
editor in the AjaxEditableLabel panel like so:
AjaxEditableLabel label = new AjaxEditableLabel("foo") {
@Override
protected FormComponent newEditor(final MarkupContainer
parent, final String componentId, final IModel model) {
final FormComponent form = super.newEditor(parent, componentId,
model);
form.add(new MyAutoCompleteBehavior());
return form;
}
};
Patrick
-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org