Soumitri Pattnaik
Soumitri Pattnaik

Reputation: 3556

How to write a bean auto complete in wicket 1.4?

I want a bean auto complete.
I like the way the wicket DropDownChoice works.
We can add ChoiceRenderer to the DropDownChoice to display whatever we want. And we can also set a bean object as the model object.

I want the auto complete to work exactly the same way.
I have tried it several times, but in vain.
I know there AbstactAutoCompleteRender and all, but I have always found that, the auto completes work well with Strings only.
So I have to convert my bean list to string list of some attribute of the bean and then do the auto complete logic, and then figure out the bean by doing some operations on the String (the model object).

It's working but, it's just too much of hustle for a thing, that can be easily done in DropDownChoice.
May be in latter version of wicket there is a bean auto complete, but is there any ways to achieve a simple bean auto complete in wicket 1.4.x?

Upvotes: 0

Views: 77

Answers (1)

martin-g
martin-g

Reputation: 17503

wicket-extensions' Autocompleter works only with String as a model. You can use https://github.com/wicketstuff/core/tree/core-1.4.x/jdk-1.5-parent/objectautocomplete-parent instead.

Upvotes: 1

Related Questions