Skip to Content

1 Comment

You must be Logged on to comment or reply to a post.

  1. Boghyon Hoffmann

    Another alternative way to set (not only) a favicon is to use the property homeIcon from sap.m.Shell or jQuery.sap.setIcons if the Shell is not being used. In this way the favicon will be retrieved at the end when the document is loaded completely, thus enabling the bootstrap to start earlier (instead of waiting for the favicon to load).

    With Shell:

    sap.ui.getCore().attachInit(function() {
    	sap.ui.component({
    		async: true,
    		manifestFirst: true,
    		name: "namespace"
    	}).then(function(Component) {
    		new sap.m.Shell({
    			homeIcon: {
    				'favicon':'icon/logo.ico',
    				'phone':'icon/logo_57px.png',
    				'phone@2':'icon/logo_114px.png',
    				'tablet':'icon/logo_72px.png',
    				'tablet@2':'icon/logo_144px.png',
    				'precomposed': false // whether the home icons already have some glare effect (for iOS)
    			},
    			showLogout: false,
    			app: new sap.ui.core.ComponentContainer({
    				component: Component,
    				height:"100%"
    			})
    		}).placeAt("content");
    	});
    }

    Without Shell:

    sap.ui.getCore().attachInit(function() {
    	jQuery.sap.setIcons({
    		'favicon':'icon/logo.ico',
    		'phone':'icon/logo_57px.png',
    		'phone@2':'icon/logo_114px.png',
    		'tablet':'icon/logo_72px.png',
    		'tablet@2':'icon/logo_144px.png',
    		'precomposed': false
    	});
    
    	sap.ui.component({
    		// ...
    	}).then(function(Component) {
    		new sap.ui.core.ComponentContainer({
    			component: Component,
    			height:"100%"
    		}).placeAt("content");
    	});
    }

     

    (2) 

Leave a Reply