I believe I have it working as such:
class PhoneNumber implements Serializable {
private String one;
private String two;
public PhoneNumber(String str) {
// Parse str and set one and two
}
// setters & getters *snipped*
public String toString() {
return one + two;
}
}
public Phone(String id, IModel m) {
super(id);
phone = new PhoneNumber(m.getObject(this).toString());
m.setObject(this, phone);
add(new TextField("one", new PropertyModel(phone, "one")));
add(new TextField("two", new PropertyModel(phone, "two")));
}
And on my page I do:
add(new Phone("wicket:id", new PropertyModel(myObject, "theField")));
Cheers,
-Jonathan
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user