Consider following form which uses ListView with pull model.

public MyForm extends Form {
    public MyForm(String id, IModel model) {
        super(id, model);
        add(new ListView("items") {
            public IModel getModel() {
                return new Model(dao.findAll());

            protected void populateItem(final ListItem item) {
                FormComponent text1 = new TextField("t1");
                FormComponent text2 = new TextField("t2");
                MyForm.this.add(new MyFormValidator(text1, text2));

    protected void onSubmit() {
        // hello world!

Now, the first submit is ok, but if the validation fails during the
first submit and the user presses submit again, the whole form fails to 
Caused by: java.lang.IllegalStateException: No Page found for component
[MarkupContainer [Component id = TextField.text, page = <No Page>, path
= 1:semester.length:start:TextField.text]]
  at wicket.Component.getPage(
  at wicket.Component.hasErrorMessage(

Why? Because the Form instance contains FormValidators which reference
old instances of FormComponents. These old instances are not in a Form
after the first submit because the ListView uses pull model and
therefore can't call setReuseItems(true);

So, it seems that it is not possible to use pull model ListView in a


Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
Wicket-user mailing list

Reply via email to