You are not chaining...

This is how:

new PropertyModel(userModel,"contacts")



Neil McT wrote:
Sure.....

Originally I had it set up like....
(note that userModel is a LDM which wraps a SystemUser. SystemUser contains
a collection of Contact objects).

final WebMarkupContainer listContainer = new
WebMarkupContainer("listContainer");
  ListView displayList = new ListView("contactsList",
userModel.getObject().getContacts()){
    @Override
    protected void populateItem(final ListItem item) {
      Contact contact = (Contact)item.getModelObject();
      item.add(new Label("contactName", contact.getName()));
etc etc

This was producing the original error....

AbstractPersistentCollection.owner [class=com.myapp.domain.SystemUser]
<----- field that is not serializable
I then tried.....

final WebMarkupContainer listContainer = new
WebMarkupContainer("listContainer");
  ListView displayList = new ListView(
           "contactsList", new PropertyModel(userModel.getObject(),
"contacts")){
    @Override
    protected void populateItem(final ListItem item) {
        item.add(new Label("contactName",
((Contact)item.getModelObject()).getName()));

etc etc

And was getting
private java.lang.Object
org.apache.wicket.model.AbstractPropertyModel.target
[class=com.pyso.domain.SystemUser] <----- field that is not serializable

I'm assuming, from the PropertyModel.                   



jwcarman wrote:
How about sharing some code with us as to how you're setting up your
models?




--
-Wicket for love

Nino Martinez Wael
Java Specialist @ Jayway DK
http://www.jayway.dk
+45 2936 7684


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to