1 数据列表控件ListView
Wicket doc中关于ListView有如下表述:
setReuseItems
public ListView<T> setReuseItems(boolean reuseItems)
- If true re-rendering the list view is more efficient if the windows doesn't get changed at all or if it gets scrolled (compared to paging). But if you modify the listView model object, than you must manually call listView.removeAll() in order to rebuild the ListItems. If you nest a ListView in a Form, ALLWAYS set this property to true, as otherwise validation will not work properly.
- 所以在from中使用ListView,想更好的re-rendering的话,调用 setReuseItems(true)!
2 Button
是调用Button的onSubmit method还是调用Form的onSubmit method,调用顺序如何?请看下面
http://wicket.apache.org/docs/1.4/org/apache/wicket/markup/html/form/Button.html
One other option you should know of is the 'defaultFormProcessing' property of Button components. When you set this to false (default is true), all validation and formupdating is bypassed and the onSubmit method of that button is called directly, and the onSubmit method of the parent form is not called. A common use for this is to create a cancel button.