Search in sources :

Example 1 with Address

use of org.webpieces.webserver.basic.app.biz.Address 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);
}
Also used : Account(org.webpieces.webserver.tags.app.Account) Address(org.webpieces.webserver.basic.app.biz.Address) UserDto(org.webpieces.webserver.basic.app.biz.UserDto)

Aggregations

Address (org.webpieces.webserver.basic.app.biz.Address)1 UserDto (org.webpieces.webserver.basic.app.biz.UserDto)1 Account (org.webpieces.webserver.tags.app.Account)1