Re: autocomplete for AjaxEditableLabel

2010-08-30 Thread Patrick Petermair


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:


AjaxEditableLabelString label = new AjaxEditableLabelString(foo) {

@Override
protected FormComponentString newEditor(final MarkupContainer
  parent, final String componentId, final IModelString 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



autocomplete for AjaxEditableLabel

2010-08-27 Thread Patrick Petermair

Hi!

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.


Any help? What would be the correct way to do it?

Cheers,
Patrick

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org