Binder and list of components

Hi,

two questions about using Binder:

  1. If I only need to display data, but not edit (all read-only fields), would you still recommend using Binder, or is .setValue() just fine? Pros/cons?
  2. How would you use Binder with a list of components? Let’s say I have a person with a list of addresses. My form shows the person data and below that I want to show all addresses.

Thanks.

  1. If all fields will always be readonly, then Binder might be redundant since you end up with more code to configure x bindings than to just run x setter methods in the place you would otherwise do binder.readBean. One special case is if you have things set up to create those bindings using reflection with bindInstanceFields instead of explicitly configuring each binding. There’s also a ReadOnlyHasValue class might be useful for some related cases.
  2. This is most often done by creating a custom field component with e.g. List<Address> as its value type and then inside that component creating a separate Binder instance for each row.