Nested properties

3 views
Skip to first unread message

Fer

unread,
Apr 23, 2009, 4:36:03 PM4/23/09
to Wicket Web Beans
Hello WWB team, first of all, congrats for your great project. It's
what i looking for.

I have this problem with nested beans and properties:


public class Person implements Serializable{

private String personName;

public String getPersonName() {
return personName;
}

}

public class Dog implements Serializable{

private String dogName;

private Person owner;

public Dog(final String name, final Person owner) {
super();
this.dogName = name;
this.owner = owner;
}

public String getDogName() {
return dogName;
}

public Person getOwner() {
return owner;
}

}


What i trying to do is show a list of viewOnly dogs.

In this table i will like two columns, the dogName and the
personName.

There is a way to create a context like:

Dog {
viewOnly: true;
props: dogName,owner.personName;
}

the code:

List<Dog> dogs //Or maybe a IModel<List<Dog>>
BeanMetaData meta = new BeanMetaData(Device.class, null, this, null,
false);
add(new BeanForm("dogs", listOfDogs, meta));


This kind of scenarios may happen in 1 to 1, or N to 1 relationship.


Regards and sorry for my english
Fernando

Dan Syrstad

unread,
Apr 23, 2009, 10:29:11 PM4/23/09
to wicket-w...@googlegroups.com
Right now in WWB 1.1, you have to add a property to Dog - something like getOwnerName(). You cannot use a property path expression. Otherwise, the viewOnly context you're trying to create looks like it should work.
-Dan
Reply all
Reply to author
Forward
0 new messages