SlideShare a Scribd company logo
Emanuele Ricci & Wouter Lemaire
June 22, 2018
Get started with UI5 custom
controls
2
Revisions and Usage
2
i
 Author Emanuele Ricci & Wouter Lemaire
 Creation Date 04/06/2018
 Document Usage Presentation for internal use.
 Document Revision 2018.06.04-21.35
 Validity Starting June 04th 2018 – Replaces all previous templates
Contact Emanuele.ricci@techedgegroup.com for any questions regarding this
document
3
Contact Information
3
Emanuele Ricci
SAPUI5 Ninja Developer
SAPUI5 Ninja, Android Enthusiastic and tech lover in general. I’m a
full stack engineer based in Lucca that works with bleeding edge
technologies since high school.
Wouter Lemaire
SAP Development Consultant
• SAPUI5
• Fiori
• ABAP
• SAP Web IDE
• SAP Mentor
Let’s start
5
• This talk will help you to learn how to create a custom control and
how to build a custom library to be re-used in all your project.
• Final Project: openui5-lightbox2
Introduction
5
6
• OpenUI5
• WebIDE
Technologies Used
6
Configure SAP Web IDE
8
• UI5 Lab Feature: contains the template for the UI5 Library
• UI5 Library Manager
Configure Destinations
8
9
Enable this plugins on your WebIDE
9
Generate UI5 Library
11
Generate your Library from UI5Lab Library 1/2
11
12
Generate your Library from UI5Lab Library 2/2
12
13
Build & Test
13
Include Lightbox2
15
Include the Lightbox2 JS Library 1/3
15
16
Images will not be
downloaded due to CORS.
Include the Lightbox2 JS Library 2/3
16
17
Include the CSS file by
adding the reference in your
library.source.less base
folder
Include the Lightbox2 JS Library 3/3
17
@import (inline)
"../../libs/lightbox
2/css/lightbox.cs
s";
Anatomy Custom Control
19
A custom control is a JavaScript object that has two special sections
(metadata and renderer) and a number of methods that implement the
functionality of the control.
Anatomy of a Custom Control 1/2
19
20
Anatomy of a Custom Control 2/2
20
21
The metadata section defines the data structure and thus the API of
the control. With this meta information on the properties, events, and
aggregations of the control OpenUI5 automatically creates setter and
getter methods and other convenience functions that can be called
within the app.
Metadata
22
• A property is defined by a name and a type. Additionally, a default
value can be defined for a property.
• type: Data type of the control property; SAPUI5 provides an
automatic type validation. Valid types are, for example, string
(default) for a string property, int or float for number properties, int[],
etc. for arrays and sap.ui.core.CSSSize for a custom-defined type.
• defaultValue: Default value that is set if the application does not set
a value; if no default value is defined, the property value is
undefined.
Properties
23
• An aggregation is a strong relation that also manages the lifecycle of
the related control, for example, when the parent is destroyed, the
related control is also destroyed.
• An association is a weak relation that does not manage the lifecycle
and can be defined multiple times. To have a clear distinction, an
association only stores the ID, whereas an aggregation stores the
direct reference to the control.
Aggregations and Associations
24
• Events allow you to expose which events will be fired by your
custom control and which parameters will be shipped with it.
• For each event, methods for registering, de-registering and firing the
event are created.
• You can gather more documentation about the metadata
section here.
Events
24
25
• The renderer defines the HTML structure that will be added to the
DOM tree of your app whenever the control is instantiated in a view.
It is usually called initially by the core of OpenUI5 and whenever a
property of the control is changed. The parameter oRM of the render
function is the OpenUI5 render manager that can be used to write
strings and control properties to the HTML page.
• You can gather more documentation about the renderer
section here and here.
Renderer
25
26
• library.js
• Translations: messagebundle.properties (not needed in this
example)
• Themes: library.source.less, shared.css, img, img-RTL (not needed
in this example)
• Control and Renderer
• For a deeper explanation on the development process you can take
a look a the official control library documentation.
Anatomy of a Custom Library
26
27
• The library.js file is a central file for each control library that contains
the library declaration and any enums, simple types and interfaces
present in the library. There can also be additional code and the
definition of lazy loading stubs for non-controls.
• The most important feature in this file from the perspective of a
control developer is the list of controls maintained in the library
declaration: all controls must be added there in order to make their
constructors available immediately when the library is loaded (so
applications only need to require the library, not each control).
Library.js 1/2
27
28
Library.js 1/2
28
29
Update the WebIDE Test Code
29
sap.ui.getCore().attachInit(function() {
var oLightbox = new com.sap.ui5con.Lightbox({
gallery:"lightbox-gallery",
alwaysShowNavOnTouchDevices:false,
albumLabel:"UI5image %1of %2",
disableScrolling:false,
fadeDuration:600,
fitImagesInViewport:true,
imageFadeDuration:600,
positionFromTop:50,
resizeDuration:700,
showImageNumberLabel:true,
wrapAround:false,
content:[
new com.sap.ui5con.LightboxImage({src:"https://s3-us-west-
2.amazonaws.com/s.cdpn.io/82/orange-tree.jpg",title:"Title 1",alt:"Alt1"}),
new com.sap.ui5con.LightboxImage({src:"https://s3-us-west-
2.amazonaws.com/s.cdpn.io/82/submerged.jpg",title:"Title2",alt:"Alt2"})
]
});
oLightbox.placeAt("content");
});
Get your hands dirty
31
Now you have all the informations to start writing code and build your UI5 Custom Library on
WebIDE
https://goo.gl/zVkCoM
Get your hands dirty!
31
Consume the library
33
Remember the Application name  Deploy
Deploy the library on SCP
33
34
Consume the Library
34
35
Configure neo-app.json
35
{
"path": "/resources/com/sap/ui5con",
"target": {
"type": "application",
"name": "myui5library",
"entryPath":
"/resources/com/sap/ui5con"
},
"description": "UI5Lab Space Library"
}
36
Add the library dependency in your manifest.json
36
37
Add the control to your View
37
38
Enjoy!
38
Thank you.
Contact information:
Emanuele Ricci
Wouter Lemaire

More Related Content

What's hot

Siebel Open UI Debugging (Siebel Open UI Training, Part 7)
Siebel Open UI Debugging (Siebel Open UI Training, Part 7)Siebel Open UI Debugging (Siebel Open UI Training, Part 7)
Siebel Open UI Debugging (Siebel Open UI Training, Part 7)
Tech OneStop
 
Lecture 32
Lecture 32Lecture 32
Lecture 32
Jannat Khan
 
Customizing the Presentation Model and Physical Renderer in Siebel Open UI
Customizing the Presentation Model and Physical Renderer in Siebel Open UICustomizing the Presentation Model and Physical Renderer in Siebel Open UI
Customizing the Presentation Model and Physical Renderer in Siebel Open UI
Tech OneStop
 
Angular 9 New features
Angular 9 New featuresAngular 9 New features
Angular 9 New features
Ahmed Bouchefra
 
Top 8 benefits of react js
Top 8 benefits of react jsTop 8 benefits of react js
Top 8 benefits of react js
Rani Sinha
 
Android Modularization
Android ModularizationAndroid Modularization
Android Modularization
Young-Hyuk Yoo
 
Angular%201%20to%20angular%202
Angular%201%20to%20angular%202Angular%201%20to%20angular%202
Angular%201%20to%20angular%202
Ran Wahle
 
From React to React Native - Things I wish I knew when I started
From React to React Native - Things I wish I knew when I startedFrom React to React Native - Things I wish I knew when I started
From React to React Native - Things I wish I knew when I started
sparkfabrik
 
Infinum Android Talks #12 - MVP design pattern for Android Apps
Infinum Android Talks #12 - MVP design pattern for Android AppsInfinum Android Talks #12 - MVP design pattern for Android Apps
Infinum Android Talks #12 - MVP design pattern for Android Apps
Infinum
 
Java springboot microservice - Accenture Technology Meetup
Java springboot microservice - Accenture Technology MeetupJava springboot microservice - Accenture Technology Meetup
Java springboot microservice - Accenture Technology Meetup
Accenture Hungary
 
Mastering angular - Dot Net Tricks
Mastering angular - Dot Net TricksMastering angular - Dot Net Tricks
Mastering angular - Dot Net Tricks
Gaurav Singh
 
Vue micro frontend implementation patterns
Vue micro frontend implementation patternsVue micro frontend implementation patterns
Vue micro frontend implementation patterns
Albert Brand
 
Model View Presenter
Model View Presenter Model View Presenter
Model View Presenter
rendra toro
 
Android Architecture MVP Pattern
Android Architecture MVP Pattern Android Architecture MVP Pattern
Android Architecture MVP Pattern
Jeff Potter
 
Dependency Injection pattern in Angular
Dependency Injection pattern in AngularDependency Injection pattern in Angular
Dependency Injection pattern in Angular
Alexe Bogdan
 
MuleSoft Surat Virtual Meetup#3 - Anypoint Custom Policies, API Manager (Prox...
MuleSoft Surat Virtual Meetup#3 - Anypoint Custom Policies, API Manager (Prox...MuleSoft Surat Virtual Meetup#3 - Anypoint Custom Policies, API Manager (Prox...
MuleSoft Surat Virtual Meetup#3 - Anypoint Custom Policies, API Manager (Prox...
Jitendra Bafna
 
Angular Best Practices - Perfomatix
Angular Best Practices - PerfomatixAngular Best Practices - Perfomatix
Angular Best Practices - Perfomatix
Perfomatix Solutions
 
MuleSoft Surat Virtual Meetup#6 - MuleSoft Project Template Using Maven Arche...
MuleSoft Surat Virtual Meetup#6 - MuleSoft Project Template Using Maven Arche...MuleSoft Surat Virtual Meetup#6 - MuleSoft Project Template Using Maven Arche...
MuleSoft Surat Virtual Meetup#6 - MuleSoft Project Template Using Maven Arche...
Jitendra Bafna
 
Angular introduction students
Angular introduction studentsAngular introduction students
Angular introduction students
Christian John Felix
 
PHP Frameworks and CodeIgniter
PHP Frameworks and CodeIgniterPHP Frameworks and CodeIgniter
PHP Frameworks and CodeIgniter
KHALID C
 

What's hot (20)

Siebel Open UI Debugging (Siebel Open UI Training, Part 7)
Siebel Open UI Debugging (Siebel Open UI Training, Part 7)Siebel Open UI Debugging (Siebel Open UI Training, Part 7)
Siebel Open UI Debugging (Siebel Open UI Training, Part 7)
 
Lecture 32
Lecture 32Lecture 32
Lecture 32
 
Customizing the Presentation Model and Physical Renderer in Siebel Open UI
Customizing the Presentation Model and Physical Renderer in Siebel Open UICustomizing the Presentation Model and Physical Renderer in Siebel Open UI
Customizing the Presentation Model and Physical Renderer in Siebel Open UI
 
Angular 9 New features
Angular 9 New featuresAngular 9 New features
Angular 9 New features
 
Top 8 benefits of react js
Top 8 benefits of react jsTop 8 benefits of react js
Top 8 benefits of react js
 
Android Modularization
Android ModularizationAndroid Modularization
Android Modularization
 
Angular%201%20to%20angular%202
Angular%201%20to%20angular%202Angular%201%20to%20angular%202
Angular%201%20to%20angular%202
 
From React to React Native - Things I wish I knew when I started
From React to React Native - Things I wish I knew when I startedFrom React to React Native - Things I wish I knew when I started
From React to React Native - Things I wish I knew when I started
 
Infinum Android Talks #12 - MVP design pattern for Android Apps
Infinum Android Talks #12 - MVP design pattern for Android AppsInfinum Android Talks #12 - MVP design pattern for Android Apps
Infinum Android Talks #12 - MVP design pattern for Android Apps
 
Java springboot microservice - Accenture Technology Meetup
Java springboot microservice - Accenture Technology MeetupJava springboot microservice - Accenture Technology Meetup
Java springboot microservice - Accenture Technology Meetup
 
Mastering angular - Dot Net Tricks
Mastering angular - Dot Net TricksMastering angular - Dot Net Tricks
Mastering angular - Dot Net Tricks
 
Vue micro frontend implementation patterns
Vue micro frontend implementation patternsVue micro frontend implementation patterns
Vue micro frontend implementation patterns
 
Model View Presenter
Model View Presenter Model View Presenter
Model View Presenter
 
Android Architecture MVP Pattern
Android Architecture MVP Pattern Android Architecture MVP Pattern
Android Architecture MVP Pattern
 
Dependency Injection pattern in Angular
Dependency Injection pattern in AngularDependency Injection pattern in Angular
Dependency Injection pattern in Angular
 
MuleSoft Surat Virtual Meetup#3 - Anypoint Custom Policies, API Manager (Prox...
MuleSoft Surat Virtual Meetup#3 - Anypoint Custom Policies, API Manager (Prox...MuleSoft Surat Virtual Meetup#3 - Anypoint Custom Policies, API Manager (Prox...
MuleSoft Surat Virtual Meetup#3 - Anypoint Custom Policies, API Manager (Prox...
 
Angular Best Practices - Perfomatix
Angular Best Practices - PerfomatixAngular Best Practices - Perfomatix
Angular Best Practices - Perfomatix
 
MuleSoft Surat Virtual Meetup#6 - MuleSoft Project Template Using Maven Arche...
MuleSoft Surat Virtual Meetup#6 - MuleSoft Project Template Using Maven Arche...MuleSoft Surat Virtual Meetup#6 - MuleSoft Project Template Using Maven Arche...
MuleSoft Surat Virtual Meetup#6 - MuleSoft Project Template Using Maven Arche...
 
Angular introduction students
Angular introduction studentsAngular introduction students
Angular introduction students
 
PHP Frameworks and CodeIgniter
PHP Frameworks and CodeIgniterPHP Frameworks and CodeIgniter
PHP Frameworks and CodeIgniter
 

Similar to Create your own control - UI5Con

Introduction to g reg 4.6.0
Introduction to g reg 4.6.0Introduction to g reg 4.6.0
Introduction to g reg 4.6.0WSO2
 
Ruby on Rails & Version Control
Ruby on Rails & Version ControlRuby on Rails & Version Control
Ruby on Rails & Version Control
Yash Mittal
 
Software Engineering - chp6- development phase
Software Engineering - chp6- development phaseSoftware Engineering - chp6- development phase
Software Engineering - chp6- development phase
Lilia Sfaxi
 
DevOps Introduction - Main Concepts Description
DevOps Introduction - Main Concepts DescriptionDevOps Introduction - Main Concepts Description
DevOps Introduction - Main Concepts Description
BrunoOliveira631137
 
From silex to symfony and viceversa
From silex to symfony and viceversaFrom silex to symfony and viceversa
From silex to symfony and viceversa
Ronny López
 
Plugin-based IVI Architectures with Qt
Plugin-based IVI Architectures with Qt Plugin-based IVI Architectures with Qt
Plugin-based IVI Architectures with Qt
ICS
 
Extending Zend_Tool
Extending Zend_ToolExtending Zend_Tool
Extending Zend_Tool
Ralph Schindler
 
[2015/2016] Modern development paradigms
[2015/2016] Modern development paradigms[2015/2016] Modern development paradigms
[2015/2016] Modern development paradigms
Ivano Malavolta
 
Agile Secure Cloud Application Development Management
Agile Secure Cloud Application Development ManagementAgile Secure Cloud Application Development Management
Agile Secure Cloud Application Development Management
Adam Getchell
 
IncQuery Suite demo for INCOSE 2022IW
IncQuery Suite demo for INCOSE 2022IWIncQuery Suite demo for INCOSE 2022IW
IncQuery Suite demo for INCOSE 2022IW
IncQuery Labs
 
49.INS2065.Computer Based Technologies.TA.NguyenDucAnh.pdf
49.INS2065.Computer Based Technologies.TA.NguyenDucAnh.pdf49.INS2065.Computer Based Technologies.TA.NguyenDucAnh.pdf
49.INS2065.Computer Based Technologies.TA.NguyenDucAnh.pdf
cNguyn506241
 
Blisstering drupal module development ppt v1.2
Blisstering drupal module development ppt v1.2Blisstering drupal module development ppt v1.2
Blisstering drupal module development ppt v1.2
Anil Sagar
 
11.project online library management system
11.project online library management system11.project online library management system
11.project online library management systemmonika ahalawat
 
Automation Ops Series: Session 2 - Governance for UiPath projects
Automation Ops Series: Session 2 - Governance for UiPath projectsAutomation Ops Series: Session 2 - Governance for UiPath projects
Automation Ops Series: Session 2 - Governance for UiPath projects
DianaGray10
 
.net Based Component Technologies
.net Based Component Technologies.net Based Component Technologies
.net Based Component Technologies
prakashk453625
 
Oracle developer interview questions(entry level)
Oracle developer interview questions(entry level)Oracle developer interview questions(entry level)
Oracle developer interview questions(entry level)
Naveen P
 
UNIT IV DESIGN PATTERNS.pptx
UNIT IV DESIGN PATTERNS.pptxUNIT IV DESIGN PATTERNS.pptx
UNIT IV DESIGN PATTERNS.pptx
anguraju1
 
JIRA System Admin Traning
JIRA System Admin Traning JIRA System Admin Traning
JIRA System Admin Traning
Cprime
 
Introduction to OOAD
Introduction to OOADIntroduction to OOAD
Introduction to OOAD
Saraswati Saud
 

Similar to Create your own control - UI5Con (20)

Introduction to g reg 4.6.0
Introduction to g reg 4.6.0Introduction to g reg 4.6.0
Introduction to g reg 4.6.0
 
Ruby on Rails & Version Control
Ruby on Rails & Version ControlRuby on Rails & Version Control
Ruby on Rails & Version Control
 
Day 1 axway apim-training
Day 1   axway apim-trainingDay 1   axway apim-training
Day 1 axway apim-training
 
Software Engineering - chp6- development phase
Software Engineering - chp6- development phaseSoftware Engineering - chp6- development phase
Software Engineering - chp6- development phase
 
DevOps Introduction - Main Concepts Description
DevOps Introduction - Main Concepts DescriptionDevOps Introduction - Main Concepts Description
DevOps Introduction - Main Concepts Description
 
From silex to symfony and viceversa
From silex to symfony and viceversaFrom silex to symfony and viceversa
From silex to symfony and viceversa
 
Plugin-based IVI Architectures with Qt
Plugin-based IVI Architectures with Qt Plugin-based IVI Architectures with Qt
Plugin-based IVI Architectures with Qt
 
Extending Zend_Tool
Extending Zend_ToolExtending Zend_Tool
Extending Zend_Tool
 
[2015/2016] Modern development paradigms
[2015/2016] Modern development paradigms[2015/2016] Modern development paradigms
[2015/2016] Modern development paradigms
 
Agile Secure Cloud Application Development Management
Agile Secure Cloud Application Development ManagementAgile Secure Cloud Application Development Management
Agile Secure Cloud Application Development Management
 
IncQuery Suite demo for INCOSE 2022IW
IncQuery Suite demo for INCOSE 2022IWIncQuery Suite demo for INCOSE 2022IW
IncQuery Suite demo for INCOSE 2022IW
 
49.INS2065.Computer Based Technologies.TA.NguyenDucAnh.pdf
49.INS2065.Computer Based Technologies.TA.NguyenDucAnh.pdf49.INS2065.Computer Based Technologies.TA.NguyenDucAnh.pdf
49.INS2065.Computer Based Technologies.TA.NguyenDucAnh.pdf
 
Blisstering drupal module development ppt v1.2
Blisstering drupal module development ppt v1.2Blisstering drupal module development ppt v1.2
Blisstering drupal module development ppt v1.2
 
11.project online library management system
11.project online library management system11.project online library management system
11.project online library management system
 
Automation Ops Series: Session 2 - Governance for UiPath projects
Automation Ops Series: Session 2 - Governance for UiPath projectsAutomation Ops Series: Session 2 - Governance for UiPath projects
Automation Ops Series: Session 2 - Governance for UiPath projects
 
.net Based Component Technologies
.net Based Component Technologies.net Based Component Technologies
.net Based Component Technologies
 
Oracle developer interview questions(entry level)
Oracle developer interview questions(entry level)Oracle developer interview questions(entry level)
Oracle developer interview questions(entry level)
 
UNIT IV DESIGN PATTERNS.pptx
UNIT IV DESIGN PATTERNS.pptxUNIT IV DESIGN PATTERNS.pptx
UNIT IV DESIGN PATTERNS.pptx
 
JIRA System Admin Traning
JIRA System Admin Traning JIRA System Admin Traning
JIRA System Admin Traning
 
Introduction to OOAD
Introduction to OOADIntroduction to OOAD
Introduction to OOAD
 

Recently uploaded

Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualitySoftware Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Inflectra
 
Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a button
DianaGray10
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance
 
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Tobias Schneck
 
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
Product School
 
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Product School
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
Laura Byrne
 
JMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaJMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and Grafana
RTTS
 
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Albert Hoitingh
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
Safe Software
 
When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...
Elena Simperl
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
Kari Kakkonen
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
91mobiles
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
Alison B. Lowndes
 
Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !
KatiaHIMEUR1
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
DianaGray10
 
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Ramesh Iyer
 
Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*
Frank van Harmelen
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
Prayukth K V
 
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
Product School
 

Recently uploaded (20)

Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualitySoftware Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
 
Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a button
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
 
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
 
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
 
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
 
JMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaJMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and Grafana
 
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
 
When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
 
Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
 
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
 
Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
 
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
 

Create your own control - UI5Con

  • 1. Emanuele Ricci & Wouter Lemaire June 22, 2018 Get started with UI5 custom controls
  • 2. 2 Revisions and Usage 2 i  Author Emanuele Ricci & Wouter Lemaire  Creation Date 04/06/2018  Document Usage Presentation for internal use.  Document Revision 2018.06.04-21.35  Validity Starting June 04th 2018 – Replaces all previous templates Contact Emanuele.ricci@techedgegroup.com for any questions regarding this document
  • 3. 3 Contact Information 3 Emanuele Ricci SAPUI5 Ninja Developer SAPUI5 Ninja, Android Enthusiastic and tech lover in general. I’m a full stack engineer based in Lucca that works with bleeding edge technologies since high school. Wouter Lemaire SAP Development Consultant • SAPUI5 • Fiori • ABAP • SAP Web IDE • SAP Mentor
  • 5. 5 • This talk will help you to learn how to create a custom control and how to build a custom library to be re-used in all your project. • Final Project: openui5-lightbox2 Introduction 5
  • 8. 8 • UI5 Lab Feature: contains the template for the UI5 Library • UI5 Library Manager Configure Destinations 8
  • 9. 9 Enable this plugins on your WebIDE 9
  • 11. 11 Generate your Library from UI5Lab Library 1/2 11
  • 12. 12 Generate your Library from UI5Lab Library 2/2 12
  • 15. 15 Include the Lightbox2 JS Library 1/3 15
  • 16. 16 Images will not be downloaded due to CORS. Include the Lightbox2 JS Library 2/3 16
  • 17. 17 Include the CSS file by adding the reference in your library.source.less base folder Include the Lightbox2 JS Library 3/3 17 @import (inline) "../../libs/lightbox 2/css/lightbox.cs s";
  • 19. 19 A custom control is a JavaScript object that has two special sections (metadata and renderer) and a number of methods that implement the functionality of the control. Anatomy of a Custom Control 1/2 19
  • 20. 20 Anatomy of a Custom Control 2/2 20
  • 21. 21 The metadata section defines the data structure and thus the API of the control. With this meta information on the properties, events, and aggregations of the control OpenUI5 automatically creates setter and getter methods and other convenience functions that can be called within the app. Metadata
  • 22. 22 • A property is defined by a name and a type. Additionally, a default value can be defined for a property. • type: Data type of the control property; SAPUI5 provides an automatic type validation. Valid types are, for example, string (default) for a string property, int or float for number properties, int[], etc. for arrays and sap.ui.core.CSSSize for a custom-defined type. • defaultValue: Default value that is set if the application does not set a value; if no default value is defined, the property value is undefined. Properties
  • 23. 23 • An aggregation is a strong relation that also manages the lifecycle of the related control, for example, when the parent is destroyed, the related control is also destroyed. • An association is a weak relation that does not manage the lifecycle and can be defined multiple times. To have a clear distinction, an association only stores the ID, whereas an aggregation stores the direct reference to the control. Aggregations and Associations
  • 24. 24 • Events allow you to expose which events will be fired by your custom control and which parameters will be shipped with it. • For each event, methods for registering, de-registering and firing the event are created. • You can gather more documentation about the metadata section here. Events 24
  • 25. 25 • The renderer defines the HTML structure that will be added to the DOM tree of your app whenever the control is instantiated in a view. It is usually called initially by the core of OpenUI5 and whenever a property of the control is changed. The parameter oRM of the render function is the OpenUI5 render manager that can be used to write strings and control properties to the HTML page. • You can gather more documentation about the renderer section here and here. Renderer 25
  • 26. 26 • library.js • Translations: messagebundle.properties (not needed in this example) • Themes: library.source.less, shared.css, img, img-RTL (not needed in this example) • Control and Renderer • For a deeper explanation on the development process you can take a look a the official control library documentation. Anatomy of a Custom Library 26
  • 27. 27 • The library.js file is a central file for each control library that contains the library declaration and any enums, simple types and interfaces present in the library. There can also be additional code and the definition of lazy loading stubs for non-controls. • The most important feature in this file from the perspective of a control developer is the list of controls maintained in the library declaration: all controls must be added there in order to make their constructors available immediately when the library is loaded (so applications only need to require the library, not each control). Library.js 1/2 27
  • 29. 29 Update the WebIDE Test Code 29 sap.ui.getCore().attachInit(function() { var oLightbox = new com.sap.ui5con.Lightbox({ gallery:"lightbox-gallery", alwaysShowNavOnTouchDevices:false, albumLabel:"UI5image %1of %2", disableScrolling:false, fadeDuration:600, fitImagesInViewport:true, imageFadeDuration:600, positionFromTop:50, resizeDuration:700, showImageNumberLabel:true, wrapAround:false, content:[ new com.sap.ui5con.LightboxImage({src:"https://s3-us-west- 2.amazonaws.com/s.cdpn.io/82/orange-tree.jpg",title:"Title 1",alt:"Alt1"}), new com.sap.ui5con.LightboxImage({src:"https://s3-us-west- 2.amazonaws.com/s.cdpn.io/82/submerged.jpg",title:"Title2",alt:"Alt2"}) ] }); oLightbox.placeAt("content"); });
  • 30. Get your hands dirty
  • 31. 31 Now you have all the informations to start writing code and build your UI5 Custom Library on WebIDE https://goo.gl/zVkCoM Get your hands dirty! 31
  • 33. 33 Remember the Application name  Deploy Deploy the library on SCP 33
  • 35. 35 Configure neo-app.json 35 { "path": "/resources/com/sap/ui5con", "target": { "type": "application", "name": "myui5library", "entryPath": "/resources/com/sap/ui5con" }, "description": "UI5Lab Space Library" }
  • 36. 36 Add the library dependency in your manifest.json 36
  • 37. 37 Add the control to your View 37