Рубрика: Shell

FioriLaunchpad.html

sap ui5, Shell

Where you can find it:
use se80, bsp application /UI2/USHELL

add button to user interface:

zFioriRenderer.getRenderer = function(){
zFioriRenderer.renderer = sap.ushell.Container.getRenderer("fiori2");
if(!zFioriRenderer.renderer){
setTimeout(zFioriRenderer.getRenderer, 1000);
}else{
zFioriRenderer.helpBtn.button = new sap.ushell.ui.shell.ShellHeadItem( {
icon: "sap-icon://sys-help",
tooltip: "Вызов справки",
press: zFioriRenderer.helpBtn.helpFunc
});
jQuery.sap.getObject('sap.ushell.renderers.fiori2.RendererExtensions').addHeaderEndItem(zFioriRenderer.helpBtn.button);

zFioriRenderer.helpBtn.button = zFioriRenderer.renderer.addActionButton("sap.m.Button", { id: "favBtn",
text: "Фавориты",
tooltip: "Добавить на главную",
icon: "sap-icon://add-favorite",
press: zFioriRenderer.favBtn.favFunc }, true, false, ["app","home"]);
}
};

zFioriRenderer.getRenderer();

more information about add button you can find on api.

Shell toolbar Icon

Shell

If you want add button to shell, you cross with few interesting things:

If you you want use right toolbar It support only 3 button!

 

So, What???

Yes!

okm if you want do it use jquery!

for exapmle:


onAfterRendering: function(){
debugger;
try{
var pl = document.getElementById("shell-header-hdr-end");
$(pl).append( "Test" );
var b = new sap.m.Button();
}
catch (err){
debugger;
}
},


 

 

Add custom button on header shell sap ui5

Hi guys I tell you how add custom button on header shell!

So I hope it will be help for you!


setfavbutton: function() {
/**
* ADD Chat Support Button
*/
function onSupportHeaderItemPress() {
var button = new sap.ushell.ui.footerbar.AddBookmarkButton();

var info = »;
var title = »;
var subtitle = »;
var icon = »;

if (icon === «») {
//set default icon
icon = «sap-icon://home»;
}
var button = new sap.ushell.ui.footerbar.AddBookmarkButton();
button.setAppData({
title: title, // default: «»
subtitle: subtitle, // default: «»
info: info, // default: «»
icon: icon // default: undefined
});
button.firePress();
};
// add button to the right side of the shellbar
try {

if (typeof(window.favbutton) === «undefined») {
var oRendererExtensions = jQuery.sap.getObject(‘sap.ushell.renderers.fiori2.RendererExtensions’);
window.favbutton = new sap.ushell.ui.shell.ShellHeadItem(‘supportChatBtn’, {
icon: sap.ui.core.IconPool.getIconURI(‘add-favorite’),
tooltip: ‘add to main’,
showSeparator: true,
press: onSupportHeaderItemPress
});
oRendererExtensions.addHeaderEndItem(window.favbutton);
}
} catch (err) {
sap.m.MessageToast.show(err.message);
}

},