Skip to Content
Author's profile photo Muhammad Raza Hasan

Using Custom UI5 libraries in SAP Fiori on SAP ABAP Repository

Don’t feel left alone if you don’t have WebIDE and don’t know how to use Custom UI5 libraries in SAP Fiori on SAP ABAP Repository.

For custom UI5 libraries, I am using UI5Lab, you can find there interesting new custom controls to use in your SAP Fiori app.


First, you need is to download custom library in your system from Github, For that I usually use SmartGit.

Open UI5Lab and click on Source Code.

Now download that repository on your system.

Copy content of dist>resources folder in your app under libs folder. (in our case ui5lab folder)

Then add ui5lab in your manifest.js file.

Also add manifest: true in your component.js file


Simple as that your Custom UI5 library is now available to use in your app with alias ui5lab.wl.pdf.


Let’s try to use it now.

I have added ui5lab.wl.pdf with pdf namespace in my view as mentioned below. 

<core:View controllerName="app.pdf.view.Page" 
	xmlns="sap.m" height="100%">
	<Page showHeader="false">
			<f:SimpleForm id="AttachmentForm" minWidth="1024" editable="true" layout="ResponsiveGridLayout" title="LR_ATTACHMENTS_FORM" class="editableForm">
			<pdf:PdfViewer pdfSource="{/pdfsource}" />
				<ToolbarSpacer />
				<ToolbarSpacer />
				<ToolbarSpacer />
				<Button icon="sap-icon://paper-plane" iconFirst="true" iconDensityAware="true" type="Accept" text="Submit" press="onSubmit" />

 And my controller is as following: 


], function (jQuery, Controller, JSONModel, MessageToast, FileUploader) {
	"use strict";

	var PageController = Controller.extend("app.pdf.view.Page", {

		reader: {},
		onInit: function () {
			var that = this;
			this._oModel = new JSONModel({
				pdfsource: ""
			this.reader = new FileReader();
			this.reader.onload = function(oEvent){

		onBeforeRendering: function () {
			var that = this;
			var oAttachmentForm = this.getView().byId("AttachmentForm");
			oAttachmentForm.addContent(new sap.m.Label("AttachmentFile_Label", { text: "LR_SEL_ATTACH" }));
			oAttachmentForm.addContent(new FileUploader("fileUploader", {
				style: "Emphasized",
				fileType: "pdf,jpeg,jpg,png",
				width: "100%",
				change: function (oEvent) {
					var file = oEvent.getParameter("files")[0];
				typeMissmatch: function (oEvent) {
					var aFileTypes = oEvent.getSource().getFileType();
					jQuery.each(aFileTypes, function (key, value) { aFileTypes[key] = "*." + value });
					var sSupportedFileTypes = aFileTypes.join(", ");"LR_ATTACHMENT_TYPECHECK", [oEvent.getParameter("fileType"), sSupportedFileTypes]));

	return PageController;



Custome UI5 library is now working in my SAPUI5 app.


Assigned Tags

      Be the first to leave a comment
      You must be Logged on to comment or reply to a post.