Skip to content

Instantly share code, notes, and snippets.

@gbvaibhav
Created March 16, 2017 11:47
Show Gist options
  • Save gbvaibhav/02b667afb34d9ae2d972dbce0929b70e to your computer and use it in GitHub Desktop.
Save gbvaibhav/02b667afb34d9ae2d972dbce0929b70e to your computer and use it in GitHub Desktop.
sapui5 icon Tab bar selection change at the click of a button https://jsbin.com/dobuqeb
<!DOCTYPE html>
<html><head>
<meta name="description" content="UI5 List example with local JSON model" />
<meta http-equiv='X-UA-Compatible' content='IE=edge' />
<meta http-equiv='Content-Type' content='text/html;charset=UTF-8'/>
<title>SAPUI5 Example gbvaibhav</title>
<!-- Load UI5, select gold reflection theme and the "commons" and "table" control libraries -->
<script src="https://sapui5.hana.ondemand.com/resources/sap-ui-core.js"
id="sap-ui-bootstrap"
data-sap-ui-libs="sap.m,sap.ui.layout"
data-sap-ui-xx-bindingSyntax="complex"
data-sap-ui-theme="sap_bluecrystal"></script>
<script>
var iconTab = new sap.m.IconTabBar({
items:[
new sap.m.IconTabFilter({
text:"Tab 1",
key:"tab1",
content:[new sap.m.Button({
text:"go to Tab 2",
press:function(){
iconTab.setSelectedKey("tab2")
}
})]
}),
new sap.m.IconTabFilter({
text:"Tab 2",
key:"tab2",
content:[new sap.m.Button({
text:"go to Tab 1",
press:function(){
iconTab.setSelectedKey("tab1")
}
})]
})
]
})
var page = new sap.m.Page({
title:"SAPUI5 List Example",
content:[
iconTab
]
});
// finally place the App into the UI
var app = new sap.m.App({
pages: [page]
}).placeAt("content");
</script>
</head>
<body>
<div id='content'></div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment