Given an Apache Isis project with a simple domain model such as below, what are the absolute minimum requirements for a create dialogue that will display a dropdown selection of all available Offices when creating a new Person?
Current state: I can create an office objects, list all office objects, but when I want to create a Person, the create dialogue doesn't show a dropdown of the available offices, it just says "(none)" (see screenshot).
Currently my create dialogue for Person looks like this:
How can I display a dropdown of all available offices in this dialogue?
Here is a rough layout of the DOM code I have (JDO annotations omitted):
public class Office {
private String name;
// getter/setter ...
}
public class Person {
private String name;
private Office office;
// getter/setter...
}
and corresponding menu/repository classes such as
public class OfficeRepository {
public List<Office> listAll() {
// ...
}
}
public class PersonRepository {
public Person create(String name, final Office office) {
// ...
}
}
public class PersonMenu {
public static class CreateDomainEvent extends ActionDomainEvent<Person> {}
@Action(domainEvent = CreateDomainEvent.class)
public Person create(
@ParameterLayout(named="Name")
final String name,
final Office office) {
return personRepository.create(name, office);
}
}