use of org.webpieces.webserver.tags.app.Account in project webpieces by deanhiller.
the class BeansController method arrayForm.
public Action arrayForm() {
UserDto user = new UserDto();
//in which case you could add new UserDto as well
for (int i = 0; i < 3; i++) {
Account acc = new Account();
if (i == 0)
acc.setName("FirstAccName");
else
acc.setName("SecondAccName");
user.getAccounts().add(acc);
acc.getAddresses().add(null);
Address address2 = new Address();
address2.setStreet("someStreet2-" + i);
acc.getAddresses().add(address2);
}
return Actions.renderThis("user", user);
}