Sub UI views
Sub UI views represent relationships between different entities. They enable you to navigate easily between :
- entities linked by relationship.
- unbound entity view properties of the collection type. These relationships can be collections or references.
Collections
To navigate a linked collection (embedded or not).
For example, if you have an OrderHeader entity and an OrderLine entity, you can have an OrderLines sub-view which represents all the lines in an order.
classDiagram
Party "1" -- "*" PartyAddress : contains
class Party {
+PartyId : Integer
+FirstName: string
+LastName : string
+Addresses : List<Address>
}
class PartyAddress {
+Id : Integer
+PartyId : Integer
+FullAddress : string
}
This sub-view is linked to the collection relationship between the Party and its Addresses.
If it's not embedded in the entity view PartyView, an api call will automatically be made to retrieve the linked collection.
If it is embedded, the data is already in the parent's api call, so the collection is already populated.
References
All references can be added as a sub UI view (embedded or not).
In the following example, Party is a reference in Customer.
classDiagram
Customer "1" -- "1" Party : contains
class Customer {
+Id : Integer
+VATCode : string
+Party : Party
}
class Party {
+PartyId : Integer
+FirstName: string
+LastName : string
+Addresses : List<Address>
}
This sub-view is linked to the reference relationship between the Customer and its Party.
If it's not embedded in the entity view CustomerView, an api call will automatically be made to retrieve the linked reference.
If it is embedded, the data is already in the parent's api call, so the reference is already populated.
Note
If the reference is embedded and non-editable, it is the developer's responsibility to ensure that no editable fields are displayed in the subview. Any input provided for a non-editable embedded reference will be discarded.
Sub-collections
Example of use case: Display the list of addresses of a customer for an order. (Example relationship: Customer.Party.Addresses)
classDiagram
Customer "1" -- "1" Party : contains
Party "1" -- "*" PartyAddress : contains
class Customer {
+Id : Integer
+VATCode : string
+Party : Party
}
class Party {
+PartyId : Integer
+FirstName: string
+LastName : string
+Addresses : List<Address>
}
class PartyAddress {
+Id : Integer
+PartyId : Integer
+FullAddress : string
}
In this case, you can directly choose to add a sub-view on the sub-collection (Party.Addresses).
There's no need to override the reference (Party) and the sub-collection (Addresses).
If reference Party or/and sub-collection Addresses are embedded or not, then the framework will make the API call if necessary to get sub-collection data.