cancel
Showing results for 
Search instead for 
Did you mean: 

how to identify which controls can be added in sap.m.icontabfilter?

S0021315792
Explorer
0 Kudos

Can anyone explain me why the below code works even though aggregation 'Content ' is not used inside icontabfilter. In the below code we are directly adding an image control inside icontabfilter. But ideally we should use the aggregation content tag and inside that add the control.

<mvc:View

displayBlock="true"

xmlns:mvc="sap.ui.core.mvc"

xmlns="sap.m"

controllerName="opensap.myapp.controller.App">

<App>

<pages>

<Page title="openSAP - Developing with SAPUI5">

<content>

<IconTabBar

id="idTopLevelIconTabBar">

<items>

<IconTabFilter id="start" text="1ST tab">

<Image

src="https://upload.wikimedia.org/wikipedia/commons/thumb/8/86/Wikipedia_Hello_World_Graphic.svg/2000px-W..."

height="600px"/>

</IconTabFilter>

</items>

</IconTabBar>

</content>

</Page>

</pages>

</App>

</mvc:View>

Now if we check sap.m.iconfilter in sapui5 demokit then we have an aggregation called content so ideally the code should be..

IconTabFilter id="start" text="1ST tab">

<Content>

<Image

src="https://upload.wikimedia.org/wikipedia/commons/thumb/8/86/Wikipedia_Hello_World_Graphic.svg/2000px-W..."

height="600px"/>

</content>

</IconTabFilter>

Why aggregation content is not used inside icontabfilter and directly image control is used?

qmacro
Developer Advocate
Developer Advocate
0 Kudos

Please consider spending some time formatting your code so it's readable. Better still, follow this post: Help Us To Help You - Share Your Code to present your problem context in a way that folks can better help you. Thanks.

Accepted Solutions (0)

Answers (2)

Answers (2)

qmacro
Developer Advocate
Developer Advocate
0 Kudos

It's because "content" is the default aggregation for the Icon Tab Filter control. The SDK used to mark which aggregation was default, but that identification is no longer there - so there's no reason for you to know (hence your valid question). It's good practice (IMHO) to express the XML elements even for the default aggregations, to make things clear. So I would suggest you do use <content>...</content> in your definition.

It's not (as you write it) <Content> (with a capital "C") by the way. Capitalised XML elements denote controls, all-lowercase XML elements represent (in this case) things like aggregations.

junwu
Active Contributor
0 Kudos

don't bother.....

S0021315792
Explorer
0 Kudos

Is it possible for you to state without content why it works as in other type of controls we put the aggregation name tag and then inside that place the controls..

junwu
Active Contributor
0 Kudos

you are wasting your time