i’m using a Wicket 1.4 DataTable and filter it manually like described in Apache Wicket Cookbook. It is also available in the freely available sample chapter: https://www.packtpub.com/sites/default/files/1605OS-Chapter-5-Displaying-Data-Using-DataTable.pdf
However i found in the Wicket API the FilterToolbar. Now on the internet people say that Wicket Phonebook on Wicketstuff is an example , but it’s not working.
What are the advantages of using a DataTable with the FilterToolbar compared to this manual filtering presented in Wicket Cookbook? What is the FilterToolbar doing automatically? I’m especially intrigued by this sentence about the FilterToolbar in the Wicket API Docs:
Form components are provided by columns that implement
IFilteredColumn.
Code examples or working screenshots or even pages are appreciated 🙂
I was able to run the phonebook app locally without problem. Download from https://github.com/wicketstuff/core/tree/master/jdk-1.5-parent/phonebook and run with
mvn jetty:run.The implementations of IFilteredColumn allow the filter component to be created directly by the DataTable column. Implementations exist for radio choice and text box.
Personally, I stayed away from FilterToolbar because it forces your whole table to be included in a form. This face coupled with ajax filtering “as you type” means that the browser is constantly redrawing the filter form components along with the table, causing input to be lost which is quite annoying.
One interesting aspect of FilterToolbar is that it contains some javascript to restore focus to the correct form component when the filter form is submitted without ajax (not sure about with ajax).