you can't use a CompoundPropertyModel as a non compound model..
you have to use a property model for that.


On 5/27/06, Brent Roberts < [EMAIL PROTECTED]> wrote:
With Wicket 1.1, I was able to do the following within a Form:

        protected void populateItem(ListItem listItem) {
            ImportField field = (ImportField) listItem.getModelObject();
            IModel model = new CompoundPropertyModel(field);
            WicketUtil.addComponents (
                    listItem, field, model, LIST_VIEW_FIELDS);
            listItem.add(new Label("fieldDesc", field.getFieldDesc()));
            listItem.add(new CheckBox("markedForDeletion", model));
        }

The proper values were shown based on the ids within the model.  Now with 1.2,
the result of the toString() method of the model is shown in the textfield.
Also, because of this, the CheckBox throws an exception saying that the value is
not a boolean value.

I am calling setReuseItems(true) on the listview and removeAll() prior to
setting the model on it.  Some of the components within the list view are
editable and the model was updated properly with Wicket 1.1.

FYI:  The WicketUtil.addComponents(...) method just uses reflection to determine
the field names based on the getXXX methods in the POJO and creates components
associated to these field ids in the model.




-------------------------------------------------------
All the advantages of Linux Managed Hosting--Without the Cost and Risk!
Fully trained technicians. The highest number of Red Hat certifications in
the hosting industry. Fanatical Support. Click to learn more
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=107521&bid=248729&dat=121642
_______________________________________________
Wicket-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-user

Reply via email to