Does your new Wicket app scream for needing a Google Suggest type component? AutoCompleteTextField in the wicket-extensions package is what you need to fill that void!
Simply add this field to your form, give it a model, and override the getChoices method with your own implementation thas passes back an iterator of results.
final AutoCompleteTextField field = new AutoCompleteTextField("searchField", mySearchModel) { @Override protected Iterator<String> getChoices(String input) { if (Strings.isEmpty(input)) { List<String> emptyList = Collections.emptyList(); return emptyList.iterator(); } List<String> keyMatches = new ArrayList<String>(10); return myService.searchMatches(keyMatches).iterator(); } }; |

{ 2 comments… read them below or add one }
Good, but not very exploring article. All this can be found on Wicket page.
That’s completely okay, duplication just provides more avenues for folks to find the information needed to learn.