Skip to Content

sap.m.IconTabBar binding of items

Feb 16, 2017 at 06:13 AM


avatar image


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

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

2 Answers

avatar image
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

Show 1 Share
10 |10000 characters needed characters left characters exceeded

Hi Mahesh,

Thanks you provide JSONModel. But i want to bind as ODataModel in XML view. Pls share OdataModel example.

Elena Makarenko
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,

Show 1 Share
10 |10000 characters needed characters left characters exceeded

Hi Elena,

Thanks for your reply.

The link which you provide is not opening for me. :-(

I want to bind using oDatamodel. can you suggest some other code.