e.newAddress.setAction(new Action() {
public void execute(BoundWidget w) {
final Address newAddress = new Address();
TypeLookup type = new TypeLookup();
type.id = new Integer(1);
type.name = "home";
StateLookup state = new StateLookup();
state.id = new Integer(2);
state.code = "AL";
state.name = "Alabama";
newAddress.setType(type);
newAddress.setState(state);
ArrayList list = new ArrayList();
list.add(newAddress);
System.out.println("newAddress - " + newAddress);
e.addresses.add(newAddress);
//setSelected(list); // TODO setSelected causes errors, why are we using it here, and why does it err?
}
});
e.newPhone.setAction(new Action() {
public void execute(BoundWidget w) {
final Phone phone = new Phone();
TypeLookup type = new TypeLookup();
type.id = new Integer(1);
type.name = "home";
phone.setType(type);
e.phoneNumbers.add(phone);
}