I'd like to use the CompoundPropertyModel in Wicket for creating a user.
My user class looks like this:
public class User {
private String username;
...
private Address address;
...
}
public class Address{
private String street;
...
}
If I try to access the street of the address via the User's compoundproperty model, I get a nullpointerexception, of course: "user.address.street". So I have to instantiate the class "Address" on my own in advance. Is there a more elegant way to dynamically instantiate member fields?
Thanks