Item provider is an abstraction aiming to give developer a flexible way to specify which item a form or a complex form
field should bind to and how to access that item.
-
Item providers allow to bind form views to complex nested data structures and fine tune such bindings. E.g. if a
form binds a contact address as a separate sub-form (in M5 words - e.g. as a composite field), the Magnolia user
might want to use a contact's child node to store the data (item provider that resolves a sub-node can be used),
or store the properties directly on the contact node keeping it flat (self-reference item provider case).
-
Item providers get reference items as context. I.e. an address editor from the example upon data binding will get
the root contact node so that it would be trivial to resolve the corresponding sub-node if needed.
-
Item providers kick in the form lifecycle only when the data is fetched from the backend (to populate the form) and
when the updated data needs to be flushed from the Vaadin components back to the backend (on form commit).