Skip to Content
avatar image
Former Member

Extending Standard Fiori App - Track Sales Order - Additional button not showing

Dear experts,

I am new to SAP Fiori and UI5, have try out some tutorial based on the lesson. I am currently trying to extend the standard app - Track Sales Order, would like to add a new button to the existing footer of S3 view by extending the controller, but the code is not working...no error and the screen has no effect. Can someone help or give me some guidance?

Customer.controller.js

onInit: function() {
		var page = this.getView().byId("itemDetail");
		var footer = page.getFooter();
	//	var oContent = footer.getContent();
		if(footer !== null){
		/** check if already contains a footer, then add additional button */
			footer.addContent(new sap.m.Button({
			                  text: "Test Me",
			                  type: "Accept",
			                  id: "btn_test1"
			                }));
			var oContent = footer.getContent();
			page.setFooter(footer);
		}else{
		/** no footer, create new footer */	
			page.setFooter(new sap.m.Toolbar({
			      content: [
		                new sap.m.ToolbarSpacer(),
		                new sap.m.Button({
		                  text: "Test Me",
		                  type: "Accept",
		                  id: "btn_test1"
		                })
		              ]
	            }));
		}
	},

Component.js

jQuery.sap.declare("cus.sd.salesorder.monitor.ZSD_SO_MON_EXT.Component");

// use the load function for getting the optimized preload file if present
sap.ui.component.load({
	name: "cus.sd.salesorder.monitor",  
	url: "/sap/bc/ui5_ui5/sap/sd_so_mon"
	// url: jQuery.sap.getModulePath("cus.sd.salesorder.monitor.ZSD_SO_MON_EXT") 
	// we use a URL relative to our own component; might be different if
	// extension app is deployed with customer namespace
});


cus.sd.salesorder.monitor.Component.extend("cus.sd.salesorder.monitor.ZSD_SO_MON_EXT.Component", {
	metadata: {
		version : "1.0",
		config : {
			"sap.ca.i18Nconfigs": {
				"bundleName":"cus.sd.salesorder.monitor.ZSD_SO_MON_EXT.i18n.i18n"
			},
			
		},
		
		customizing: {


			"sap.ui.controllerExtensions": {
				"cus.sd.salesorder.monitor.view.S4New": {
					controllerName: "cus.sd.salesorder.monitor.ZSD_SO_MON_EXT.view.S4NewCustom",
				},


				"cus.sd.salesorder.monitor.view.S3New": {
					controllerName: "cus.sd.salesorder.monitor.ZSD_SO_MON_EXT.view.S3NewCustom",
				},
			},
		}			
	}
});

Thank you.

Bren

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

0 Answers