Skip to Content

SAPUI5 TabContainer and TabContainer Item closable


I hope that somebody can give me an idea regarding this subject. I have a requirement where I need to display certain information in tabs in an UI5 App. I was looking for a suitable control to display this and I found that the TabStrip control is obsolete since version 1.34 and substituted by the TabContainer, this is fine, now, the old TabStrip was composed by Tabs[], this tabs have a property called closable to create the tabs closable or not, now I can't find this property or something similar in the new TabContainerItem. I find this very odd since I may want tabs not closable for some data display. I have also tried to use the IconTabBar to solve my requirement but since my component is a template that uses the binding to populate, I can't be sure if there are going to be several tabs or just one, and the IconTabBar component requires at minimum 2 IconTabFilters, so it is not the proper component for my requirement.

I hope that somebody can give me an idea about how to proceed in this matter that seems very simple but I must be missing something.

Thanks in advance for any contribution.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Aug 09, 2017 at 09:46 PM


    would this work?

    the tab container control has an event called: itemClose - here you can intercept the event and act accordingly. the name is not the same as the previous property but it may be what you need.

    hope that works for you

    Add comment
    10|10000 characters needed characters exceeded

    • Thanks Sergio for your response, actually, the event you mention could allow me to handle the close event, and ignore it for example, but regardless of it, the tab container item remains being closable, because now I can´t see any property preventing this the tab container component. What I want is to be able to use the tabs without the ¨X¨ mark in the top, so no closable at all, like a regular tabstrip. The previous component that is now obsolete allowed this with a closable parameter, but the new one does not have that, so, my question was if there´s a way to avoid the Tab Container to be closable.

  • Dec 11, 2018 at 03:54 PM

    so here is something i tried...i used the Tab Container.. and then removed the css class that shows the close button.

    $('.sapMTSItemCloseBtnCnt').css('visibility','hidden'); to remove the icon

    Add comment
    10|10000 characters needed characters exceeded