Skip to Content

sap.m.IconTabBar binding of items


I tried to display Icontab filters in IconTabBar dynamically from Odata with inputs.Please verify and share your suggetions to bind/set data to the IconTabBar.

Below pseudo code I used

XML View :

<IconTabBar id="idIconTabBarcib" select="chgCatgTabSelect" >

<items><IconTabFilter key="{ZCatg" text="{ZText}">

</IconTabFilter></items> <!-- sap.m.IconTab -->

<content></content> <!-- sap.ui.core.Control --> </IconTabBar>

Controller :

var oModel = this.getView().getModel();

var sPath = "/PENDING_DETAILS_EMP_INFOSet(ImPernr='4039',ImWiid='000001598333')";


var oContext = new sap.ui.model.Context(oModel,sPath);



var oController = this;,{

success: function(oData,oResponse){ oController.getView().byId("idIconTabBarcib").bindAggregation(oData);


error: function(oResponse){ //alert("Error"); } }) }

Please let me know what should be syntax to pass above filter values and bind it to IconTab Filter items

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

2 Answers

  • author's profile photo
    Former Member
    Feb 16, 2017 at 12:07 PM


    You can use below code:

    var iconTabBarId = this.getView().byId("iconTabBarIdName");

    var template = sap.m.IconTabFilter({

    key: "{ZCatg}"

    text: "{ZText}"


    var oModel = new sap.ui.model.json.JSONModel();

    oModel.setData({ modelData: oData.results }); // Check whether you are getting data in oData or not


    iconTabBarId.bindAggregation("items", "/modelData", template);

    after that you will get output.

    // in you code there is missing "}" see below:

    <IconTabFilter key="{ZCatg}" text="{ZText}">

    Hope this will help you!!!!


    Mahesh Phajage

    Add comment
    10|10000 characters needed characters exceeded

  • Feb 16, 2017 at 12:42 PM

    Hi Vinothkumar,

    you can find here a working example of dynamical binding of IconTabBar items:

    It is based on JSONModel, but you can easily adapt it for ODataModel.

    Best regards,

    Add comment
    10|10000 characters needed characters exceeded