简体   繁体   English

如何在wicket 1.4中编写bean自动完成?

[英]How to write a bean auto complete in wicket 1.4?

I want a bean auto complete. 我想要一个自动完成的bean。
I like the way the wicket DropDownChoice works. 我喜欢检票口DropDownChoice的工作方式。
We can add ChoiceRenderer to the DropDownChoice to display whatever we want. 我们可以将ChoiceRenderer添加到DropDownChoice中以显示我们想要的任何内容。 And we can also set a bean object as the model object. 我们还可以将bean对象设置为模型对象。

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. 我知道那里有AbstactAutoCompleteRender等等,但是我一直发现,自动完成仅适用于Strings。
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). 因此,我必须将bean列表转换为bean的某些属性的字符串列表,然后执行自动完成逻辑,然后通过对String(模型对象)执行一些操作来找出bean。

It's working but, it's just too much of hustle for a thing, that can be easily done in DropDownChoice. 它正在工作,但是,事情变得太繁琐了,可以在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 ? 也许在较新版本的wicket中有一个bean自动完成,但是有什么方法可以在wicket 1.4.x中实现一个简单的bean自动完成

wicket-extensions' Autocompleter works only with String as a model. wicket-extensions的自动填充程序仅适用于String作为模型。 You can use https://github.com/wicketstuff/core/tree/core-1.4.x/jdk-1.5-parent/objectautocomplete-parent instead. 您可以改用https://github.com/wicketstuff/core/tree/core-1.4.x/jdk-1.5-parent/objectautocomplete-parent

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM