Professional Documents
Culture Documents
Declarative Support Aggregations 91f136c
Declarative Support Aggregations 91f136c
91f136c76f4d1014b6dd926db0e91070
view on: demo kit nightly build | demo kit latest release
<div data-sap-ui-type="sap.ui.commons.Panel">
<div data-sap-ui-type="sap.ui.commons.Button" data-text="My Button
1"></div>
<div data-sap-ui-type="sap.ui.commons.Button" data-text="My Button
2"></div>
<div data-sap-ui-type="sap.ui.commons.Button" data-text="My Button
3"></div>
<div data-sap-ui-type="sap.ui.commons.Button" data-text="My Button
4"></div>
</div>
<div data-sap-ui-type="sap.ui.commons.Panel">
<div data-sap-ui-aggregation="content">
<div data-sap-ui-type="sap.ui.commons.Button" data-text="My Button
1"></div>
<div data-sap-ui-type="sap.ui.commons.Button" data-text="My Button
2"></div>
<div data-sap-ui-type="sap.ui.commons.Button" data-text="My Button
3"></div>
<div data-sap-ui-type="sap.ui.commons.Button" data-text="My Button
4"></div>
</div>
</div>
For aggregations with the cardinality “0..1” the "data-sap-ui-aggregation" attribute can
be written directly to the control tag:
<div data-sap-ui-type="sap.ui.commons.Panel">
<div data-sap-ui-aggregation="title" div data-sap-ui-
type="sap.ui.commons.Title" data-text="My Panel"></div>
</div>
The default aggregation of the declarative support is usually also the default aggregation of
the control as defined in the control’s meta information. However, when no default
aggregation is set or another aggregation should be used as a default, for example to avoid
unnecessary meta tags, it can be useful to define a so-called default aggregration attribute
on the parent controls HTML tag. This is done as follows:
data-sap-ui-default-aggregation="title"
With this, all children which are not included in the data-sap-ui-aggregation meta tag
are added to the default aggregation. This is shown in the following example: