Wicket: Forms & ListViews

  • When using ListViews within Forms, don’t use ListViews within forms! preferably you should use something else like RepeatingView.


  • If you do have to use ListViews, make sure you “setReuseItems(true)” or else the form will not remember the values you have typed in for each row in the view.
  • When setting the value of an object, make sure you set the model or somehow let wicket know of the underlying change.
void onSelectionChanged(VO newSelection) {

  textWidget.getModel().modelChanged();  // <-- GOOD a bit verbose but lets wicket know that model has changed.
  textVO.setText("hello");               // <--- BAD. wicket doesn't know that the model that wraps this VO has changed.  widget won't reflect change.

It's only fair to share...
Share on Facebook
Tweet about this on Twitter
Share on LinkedIn

Leave a Reply