SlideShare a Scribd company logo
Andreas Kunz, SAP SE
June 30, 2017
Create Your Own
UI5 Controls
– What’s Coming Up
Disclaimer
„What‘s Coming Up“ means:
 No guarantees about future features!
 What‘s there (control dev in general) has been presented last year:
 https://www.slideshare.net/andreaskunz/ui5-controls-ui5con-2016
 https://www.youtube.com/watch?v=W3Qkev2yk9w
3
JavaScript file with API, renderer and
behavior
All-imperative
Can create HTML from scratch, but
also re-use other controls internally
UI5 controls at present
4
More and more “composite controls” are being developed:
 Controls that purely consist of other controls, with some additional logic, but no own HTML
Composite Controls
SearchField (composite control)
sap.m.Input sap.m.Button
„placeholder“ property
„placeholder“ property
„press“ event
„search“ event„buttonText“ property
„text“ property
sync sync handle in control code
Outer API:
5
Creating composite controls requires lots of error-prone glue code:
 Instantiating inner controls (at the right time, and not too often), rendering them, managing lifecycle
 Making sure they are properly connected in the control hierarchy (for data models, events, invalidation)
 Forwarding outer API properties/aggregations to inner controls and vice versa
Could we get rid of all that code?
 XMLViews and Fragments are well-established and already used for composing controls.
 Just use a Fragment to define the inner controls, add an API and a way to bind inner controls to this API!
 voilà: the FragmentControl is born!
Why is the standard approach not good enough?
6
Two files:
 HelloWorld.js
– regular control implementation, with API/metadata part, but without the renderer
– inherits from sap.ui.core.FragmentControl
 HelloWorld.control.xml
– just like a regular XMLView (or rather a Fragment, hence the name)
How does a FragmentControl look?
Demo Code
7
In FragmentControls, you can bind inner controls to the outer control API.
$this: name of model which contains the outer API
Mechanism behind this feature is generic and can be used elsewhere:
sap.ui.model.base.ManagedObjectModel
We‘ll get to it later…
Digression: what is $this? ?
8
SearchField
Declarative way to map events also being investigated
Demo
9
When application should have full control over content added into your FragmentControl:
 JS file is trivial, just defines the aggregation:
 Use a sap.ui.core.FragmentProxy in XML, as placeholder for controls from outside.
Handling Aggregations, Part 1: Using aggregated controls as-provided
Demo Code
10
Handling Aggregations, Part 2: Using different controls internally
When you want to hide some properties of the internal controls or use different control type:
 Fully declare the inner control and bind some properties against the outer aggregation.
Example: application should be able to make your control display any number of buttons, but
should only control the button text and only get one consolidated event.
The binding context in the aggregation template (= the Button) refers to the respective item in the
outer aggregation, so the relative path „text“ points to a different outer control for each actual
Button.
Demo Code
11
FragmentControl is very well-suited for static, always equal control structures.
Can use aggregation binding and visibility of inner controls to handle dynamic structure.
XML Templating can be an option to:
 Handle complex structure decisions declaratively
 Set up structure in advance, possibly store result in view cache (performance!)
But feels complicated right now… working on it…
What if the structure is not always the same?
12
Initially „ControlTreeModel“ and just used for controls within a FragmentControl, then generalized.
Makes tree of UI5 controls (or other ManagedObjects) and their properties available as a model .
Just do
and set the model on a view or control, e.g. as „inputModel“, and you can:
CAVEAT: usually don‘t do this in applications! Normally, binding both controls to a separate data
model is a cleaner option, but sometimes you don‘t own both controls or don‘t know both models.
Coming back to the ManagedObjectModel
Demo Code
13
For each ListItem in oList, there will be a Button within the HorizontalLayout.
ManagedObjectModel also works for aggregations
Demo Code
14
When creating inner controls in init(), bind their properties and aggregations to a
ManagedObjectModel you create.
ManagedObjectModel in regular composite controls
Demo Code
…
15
All shown features are available in master branch and 1.48, BUT:
 Documentation and APIdoc is hidden
 Classes are marked as „private“
Productive use is discouraged because API might change, or entire feature may be removed or
renamed!
Trying the feature and giving feedback is welcome. No support guarantees.
 Source code: https://github.com/SAP/openui5/blob/master/src/sap.ui.core/src/sap/ui/core/FragmentControl.js
 Commits: https://github.com/SAP/openui5/search?p=1&q=fragmentcontrol&type=Commits
 Nightly: https://openui5nightly.hana.ondemand.com/resources/sap/ui/core/FragmentControl-dbg.js
 1.48: https://openui5.hana.ondemand.com/1.48.0/resources/sap/ui/model/base/ManagedObjectModel-dbg.js
Caveat: session title includes „what‘s coming up“!
16
FragmentControls are written like XMLView+Controller – but they have an API like controls.
Make creating composite controls much easier.
The ManagedObjectModel offers the API of a control (or other ManagedObject) as a bindable
Model.
It is created automatically in FragmentControls, to connect inner controls to the outer API, but
can be used for other purposes.
FragmentControls and ManagedObjectModel are present in UI5 1.48, but not yet documented
and intended for productive use. You can try, but they may change.
All code samples: https://github.com/akudev/UI5con2017-ControlDevNews
Summary
Thank you.
Contact information:
Andreas Kunz
andreas.kunz@sap.com
Twitter: @aku_dev
You are welcome to give feedback for this session
in the UI5con Event App

More Related Content

What's hot

500+ SAP ABAP INTERVIEW QUESTIONS WITH ANSWERS
500+ SAP ABAP INTERVIEW QUESTIONS WITH ANSWERS500+ SAP ABAP INTERVIEW QUESTIONS WITH ANSWERS
500+ SAP ABAP INTERVIEW QUESTIONS WITH ANSWERS
IICT Chromepet
 
Operating system concepts
Operating system conceptsOperating system concepts
Operating system concepts
Starlee Lathong
 
SAP ABAP Practice exam
SAP ABAP Practice examSAP ABAP Practice exam
SAP ABAP Practice exam
IT LearnMore
 
Introduce Bootstrap 3 to Develop Responsive Design Application
Introduce Bootstrap 3 to Develop Responsive Design ApplicationIntroduce Bootstrap 3 to Develop Responsive Design Application
Introduce Bootstrap 3 to Develop Responsive Design Application
eXo Platform
 
Hibernate presentation
Hibernate presentationHibernate presentation
Hibernate presentation
Manav Prasad
 
How to free up memory in SAP HANA
How to free up memory in SAP HANAHow to free up memory in SAP HANA
How to free up memory in SAP HANA
Debajit Banerjee
 
Various Table Partitioning in SAP HANA
Various Table Partitioning in SAP HANAVarious Table Partitioning in SAP HANA
Various Table Partitioning in SAP HANA
Debajit Banerjee
 
08.Abap Dialog Programming Overview
08.Abap Dialog Programming Overview08.Abap Dialog Programming Overview
08.Abap Dialog Programming Overview
sapdocs. info
 
1000 solved questions
1000 solved questions1000 solved questions
1000 solved questions
Kranthi Kumar
 
Memory consistency models
Memory consistency modelsMemory consistency models
Memory consistency models
palani kumar
 
Automate user creation using sap gui scripting
Automate user creation using sap gui scriptingAutomate user creation using sap gui scripting
Automate user creation using sap gui scripting
sparten369
 
BADI IMPLEMENTATION.pdf
BADI IMPLEMENTATION.pdfBADI IMPLEMENTATION.pdf
BADI IMPLEMENTATION.pdf
ssuser08365f
 
Css class-02
Css class-02Css class-02
Css class-02
Md Ali Hossain
 
SAP Integration With Excel - Advanced Guide
SAP Integration With Excel - Advanced GuideSAP Integration With Excel - Advanced Guide
SAP Integration With Excel - Advanced Guide
Benedict Yong (杨腾翔)
 
Php introduction
Php introductionPhp introduction
Php introduction
krishnapriya Tadepalli
 
Installation of sap HANA DB system on SUSE Linux
Installation of sap HANA DB system on SUSE LinuxInstallation of sap HANA DB system on SUSE Linux
Installation of sap HANA DB system on SUSE Linux
mehboobhafz
 
Introduction to ABAP
Introduction to ABAPIntroduction to ABAP
Introduction to ABAP
sapdocs. info
 
Table maintenance generator and its modifications
Table maintenance generator and its modificationsTable maintenance generator and its modifications
Table maintenance generator and its modifications
scribid.download
 
Linux Memory Management
Linux Memory ManagementLinux Memory Management
Linux Memory Management
Anil Kumar Pugalia
 
Step by step on changing ecc source systems without affecting data modeling o...
Step by step on changing ecc source systems without affecting data modeling o...Step by step on changing ecc source systems without affecting data modeling o...
Step by step on changing ecc source systems without affecting data modeling o...
Andre Bothma
 

What's hot (20)

500+ SAP ABAP INTERVIEW QUESTIONS WITH ANSWERS
500+ SAP ABAP INTERVIEW QUESTIONS WITH ANSWERS500+ SAP ABAP INTERVIEW QUESTIONS WITH ANSWERS
500+ SAP ABAP INTERVIEW QUESTIONS WITH ANSWERS
 
Operating system concepts
Operating system conceptsOperating system concepts
Operating system concepts
 
SAP ABAP Practice exam
SAP ABAP Practice examSAP ABAP Practice exam
SAP ABAP Practice exam
 
Introduce Bootstrap 3 to Develop Responsive Design Application
Introduce Bootstrap 3 to Develop Responsive Design ApplicationIntroduce Bootstrap 3 to Develop Responsive Design Application
Introduce Bootstrap 3 to Develop Responsive Design Application
 
Hibernate presentation
Hibernate presentationHibernate presentation
Hibernate presentation
 
How to free up memory in SAP HANA
How to free up memory in SAP HANAHow to free up memory in SAP HANA
How to free up memory in SAP HANA
 
Various Table Partitioning in SAP HANA
Various Table Partitioning in SAP HANAVarious Table Partitioning in SAP HANA
Various Table Partitioning in SAP HANA
 
08.Abap Dialog Programming Overview
08.Abap Dialog Programming Overview08.Abap Dialog Programming Overview
08.Abap Dialog Programming Overview
 
1000 solved questions
1000 solved questions1000 solved questions
1000 solved questions
 
Memory consistency models
Memory consistency modelsMemory consistency models
Memory consistency models
 
Automate user creation using sap gui scripting
Automate user creation using sap gui scriptingAutomate user creation using sap gui scripting
Automate user creation using sap gui scripting
 
BADI IMPLEMENTATION.pdf
BADI IMPLEMENTATION.pdfBADI IMPLEMENTATION.pdf
BADI IMPLEMENTATION.pdf
 
Css class-02
Css class-02Css class-02
Css class-02
 
SAP Integration With Excel - Advanced Guide
SAP Integration With Excel - Advanced GuideSAP Integration With Excel - Advanced Guide
SAP Integration With Excel - Advanced Guide
 
Php introduction
Php introductionPhp introduction
Php introduction
 
Installation of sap HANA DB system on SUSE Linux
Installation of sap HANA DB system on SUSE LinuxInstallation of sap HANA DB system on SUSE Linux
Installation of sap HANA DB system on SUSE Linux
 
Introduction to ABAP
Introduction to ABAPIntroduction to ABAP
Introduction to ABAP
 
Table maintenance generator and its modifications
Table maintenance generator and its modificationsTable maintenance generator and its modifications
Table maintenance generator and its modifications
 
Linux Memory Management
Linux Memory ManagementLinux Memory Management
Linux Memory Management
 
Step by step on changing ecc source systems without affecting data modeling o...
Step by step on changing ecc source systems without affecting data modeling o...Step by step on changing ecc source systems without affecting data modeling o...
Step by step on changing ecc source systems without affecting data modeling o...
 

Similar to UI5con 2017 - Create your own UI5 controls – what’s coming up

UI5con 2018: News from Control Development
UI5con 2018: News from Control DevelopmentUI5con 2018: News from Control Development
UI5con 2018: News from Control Development
Andreas Kunz
 
Introduction to the INTEGRAL FRAMEWORK
Introduction to the INTEGRAL FRAMEWORKIntroduction to the INTEGRAL FRAMEWORK
Introduction to the INTEGRAL FRAMEWORK
Karthik Subramanian
 
Introduction to the integral framework
Introduction to the integral frameworkIntroduction to the integral framework
Introduction to the integral framework
Karthik Subramanian
 
If the Android platform you are developing for does not support fragme.docx
If the Android platform you are developing for does not support fragme.docxIf the Android platform you are developing for does not support fragme.docx
If the Android platform you are developing for does not support fragme.docx
edwardk6
 
Open sap ui5 - week_2 unit_1_syjewa_exercises
Open sap ui5  - week_2 unit_1_syjewa_exercisesOpen sap ui5  - week_2 unit_1_syjewa_exercises
Open sap ui5 - week_2 unit_1_syjewa_exercises
Borusan Birlik Danışmanlık
 
introduction to Angularjs basics
introduction to Angularjs basicsintroduction to Angularjs basics
introduction to Angularjs basics
Ravindra K
 
Knockout in action
Knockout in actionKnockout in action
Knockout in action
Gerardo Leyes
 
iOS Development (Part 2)
iOS Development (Part 2)iOS Development (Part 2)
iOS Development (Part 2)
Asim Rais Siddiqui
 
UI Automation_White_CodedUI common problems and tricks
UI Automation_White_CodedUI common problems and tricksUI Automation_White_CodedUI common problems and tricks
UI Automation_White_CodedUI common problems and tricks
Tsimafei Avilin
 
Integrate Shindig with Joomla
Integrate Shindig with JoomlaIntegrate Shindig with Joomla
Integrate Shindig with Joomla
Anand Sharma
 
UIAutomator
UIAutomatorUIAutomator
UIAutomator
Sandip Ganguli
 
My Very First Zf App Part One
My Very First Zf App   Part OneMy Very First Zf App   Part One
My Very First Zf App Part One
isaaczfoster
 
Ios development 2
Ios development 2Ios development 2
Ios development 2
elnaqah
 
Developing Custom Controls with UI5 (OpenUI5 video lecture)
Developing Custom Controls with UI5 (OpenUI5 video lecture)Developing Custom Controls with UI5 (OpenUI5 video lecture)
Developing Custom Controls with UI5 (OpenUI5 video lecture)
Michael Graf
 
Ctools presentation
Ctools presentationCtools presentation
Ctools presentation
Digitaria
 
Rapid Prototyping with TurboGears2
Rapid Prototyping with TurboGears2Rapid Prototyping with TurboGears2
Rapid Prototyping with TurboGears2
Alessandro Molina
 
Swift
SwiftSwift
Swift
Larry Ball
 
Design Patterns in Cocoa Touch
Design Patterns in Cocoa TouchDesign Patterns in Cocoa Touch
Design Patterns in Cocoa Touch
Eliah Nikans
 
AspMVC4 start101
AspMVC4 start101AspMVC4 start101
AspMVC4 start101
Rich Helton
 
Angular2 and You
Angular2 and YouAngular2 and You
Angular2 and You
Joseph Jorden
 

Similar to UI5con 2017 - Create your own UI5 controls – what’s coming up (20)

UI5con 2018: News from Control Development
UI5con 2018: News from Control DevelopmentUI5con 2018: News from Control Development
UI5con 2018: News from Control Development
 
Introduction to the INTEGRAL FRAMEWORK
Introduction to the INTEGRAL FRAMEWORKIntroduction to the INTEGRAL FRAMEWORK
Introduction to the INTEGRAL FRAMEWORK
 
Introduction to the integral framework
Introduction to the integral frameworkIntroduction to the integral framework
Introduction to the integral framework
 
If the Android platform you are developing for does not support fragme.docx
If the Android platform you are developing for does not support fragme.docxIf the Android platform you are developing for does not support fragme.docx
If the Android platform you are developing for does not support fragme.docx
 
Open sap ui5 - week_2 unit_1_syjewa_exercises
Open sap ui5  - week_2 unit_1_syjewa_exercisesOpen sap ui5  - week_2 unit_1_syjewa_exercises
Open sap ui5 - week_2 unit_1_syjewa_exercises
 
introduction to Angularjs basics
introduction to Angularjs basicsintroduction to Angularjs basics
introduction to Angularjs basics
 
Knockout in action
Knockout in actionKnockout in action
Knockout in action
 
iOS Development (Part 2)
iOS Development (Part 2)iOS Development (Part 2)
iOS Development (Part 2)
 
UI Automation_White_CodedUI common problems and tricks
UI Automation_White_CodedUI common problems and tricksUI Automation_White_CodedUI common problems and tricks
UI Automation_White_CodedUI common problems and tricks
 
Integrate Shindig with Joomla
Integrate Shindig with JoomlaIntegrate Shindig with Joomla
Integrate Shindig with Joomla
 
UIAutomator
UIAutomatorUIAutomator
UIAutomator
 
My Very First Zf App Part One
My Very First Zf App   Part OneMy Very First Zf App   Part One
My Very First Zf App Part One
 
Ios development 2
Ios development 2Ios development 2
Ios development 2
 
Developing Custom Controls with UI5 (OpenUI5 video lecture)
Developing Custom Controls with UI5 (OpenUI5 video lecture)Developing Custom Controls with UI5 (OpenUI5 video lecture)
Developing Custom Controls with UI5 (OpenUI5 video lecture)
 
Ctools presentation
Ctools presentationCtools presentation
Ctools presentation
 
Rapid Prototyping with TurboGears2
Rapid Prototyping with TurboGears2Rapid Prototyping with TurboGears2
Rapid Prototyping with TurboGears2
 
Swift
SwiftSwift
Swift
 
Design Patterns in Cocoa Touch
Design Patterns in Cocoa TouchDesign Patterns in Cocoa Touch
Design Patterns in Cocoa Touch
 
AspMVC4 start101
AspMVC4 start101AspMVC4 start101
AspMVC4 start101
 
Angular2 and You
Angular2 and YouAngular2 and You
Angular2 and You
 

Recently uploaded

OpenMetadata Community Meeting - 5th June 2024
OpenMetadata Community Meeting - 5th June 2024OpenMetadata Community Meeting - 5th June 2024
OpenMetadata Community Meeting - 5th June 2024
OpenMetadata
 
GOING AOT WITH GRAALVM FOR SPRING BOOT (SPRING IO)
GOING AOT WITH GRAALVM FOR  SPRING BOOT (SPRING IO)GOING AOT WITH GRAALVM FOR  SPRING BOOT (SPRING IO)
GOING AOT WITH GRAALVM FOR SPRING BOOT (SPRING IO)
Alina Yurenko
 
Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Need for Speed: Removing speed bumps from your Symfony projects ⚡️Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Łukasz Chruściel
 
Oracle Database 19c New Features for DBAs and Developers.pptx
Oracle Database 19c New Features for DBAs and Developers.pptxOracle Database 19c New Features for DBAs and Developers.pptx
Oracle Database 19c New Features for DBAs and Developers.pptx
Remote DBA Services
 
Mobile App Development Company In Noida | Drona Infotech
Mobile App Development Company In Noida | Drona InfotechMobile App Development Company In Noida | Drona Infotech
Mobile App Development Company In Noida | Drona Infotech
Drona Infotech
 
Artificia Intellicence and XPath Extension Functions
Artificia Intellicence and XPath Extension FunctionsArtificia Intellicence and XPath Extension Functions
Artificia Intellicence and XPath Extension Functions
Octavian Nadolu
 
APIs for Browser Automation (MoT Meetup 2024)
APIs for Browser Automation (MoT Meetup 2024)APIs for Browser Automation (MoT Meetup 2024)
APIs for Browser Automation (MoT Meetup 2024)
Boni García
 
DDS-Security 1.2 - What's New? Stronger security for long-running systems
DDS-Security 1.2 - What's New? Stronger security for long-running systemsDDS-Security 1.2 - What's New? Stronger security for long-running systems
DDS-Security 1.2 - What's New? Stronger security for long-running systems
Gerardo Pardo-Castellote
 
socradar-q1-2024-aviation-industry-report.pdf
socradar-q1-2024-aviation-industry-report.pdfsocradar-q1-2024-aviation-industry-report.pdf
socradar-q1-2024-aviation-industry-report.pdf
SOCRadar
 
Fundamentals of Programming and Language Processors
Fundamentals of Programming and Language ProcessorsFundamentals of Programming and Language Processors
Fundamentals of Programming and Language Processors
Rakesh Kumar R
 
2024 eCommerceDays Toulouse - Sylius 2.0.pdf
2024 eCommerceDays Toulouse - Sylius 2.0.pdf2024 eCommerceDays Toulouse - Sylius 2.0.pdf
2024 eCommerceDays Toulouse - Sylius 2.0.pdf
Łukasz Chruściel
 
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOMLORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
lorraineandreiamcidl
 
Enterprise Resource Planning System in Telangana
Enterprise Resource Planning System in TelanganaEnterprise Resource Planning System in Telangana
Enterprise Resource Planning System in Telangana
NYGGS Automation Suite
 
Transform Your Communication with Cloud-Based IVR Solutions
Transform Your Communication with Cloud-Based IVR SolutionsTransform Your Communication with Cloud-Based IVR Solutions
Transform Your Communication with Cloud-Based IVR Solutions
TheSMSPoint
 
Orion Context Broker introduction 20240604
Orion Context Broker introduction 20240604Orion Context Broker introduction 20240604
Orion Context Broker introduction 20240604
Fermin Galan
 
Hand Rolled Applicative User Validation Code Kata
Hand Rolled Applicative User ValidationCode KataHand Rolled Applicative User ValidationCode Kata
Hand Rolled Applicative User Validation Code Kata
Philip Schwarz
 
Empowering Growth with Best Software Development Company in Noida - Deuglo
Empowering Growth with Best Software  Development Company in Noida - DeugloEmpowering Growth with Best Software  Development Company in Noida - Deuglo
Empowering Growth with Best Software Development Company in Noida - Deuglo
Deuglo Infosystem Pvt Ltd
 
SWEBOK and Education at FUSE Okinawa 2024
SWEBOK and Education at FUSE Okinawa 2024SWEBOK and Education at FUSE Okinawa 2024
SWEBOK and Education at FUSE Okinawa 2024
Hironori Washizaki
 
Why Choose Odoo 17 Community & How it differs from Odoo 17 Enterprise Edition
Why Choose Odoo 17 Community & How it differs from Odoo 17 Enterprise EditionWhy Choose Odoo 17 Community & How it differs from Odoo 17 Enterprise Edition
Why Choose Odoo 17 Community & How it differs from Odoo 17 Enterprise Edition
Envertis Software Solutions
 
E-commerce Application Development Company.pdf
E-commerce Application Development Company.pdfE-commerce Application Development Company.pdf
E-commerce Application Development Company.pdf
Hornet Dynamics
 

Recently uploaded (20)

OpenMetadata Community Meeting - 5th June 2024
OpenMetadata Community Meeting - 5th June 2024OpenMetadata Community Meeting - 5th June 2024
OpenMetadata Community Meeting - 5th June 2024
 
GOING AOT WITH GRAALVM FOR SPRING BOOT (SPRING IO)
GOING AOT WITH GRAALVM FOR  SPRING BOOT (SPRING IO)GOING AOT WITH GRAALVM FOR  SPRING BOOT (SPRING IO)
GOING AOT WITH GRAALVM FOR SPRING BOOT (SPRING IO)
 
Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Need for Speed: Removing speed bumps from your Symfony projects ⚡️Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Need for Speed: Removing speed bumps from your Symfony projects ⚡️
 
Oracle Database 19c New Features for DBAs and Developers.pptx
Oracle Database 19c New Features for DBAs and Developers.pptxOracle Database 19c New Features for DBAs and Developers.pptx
Oracle Database 19c New Features for DBAs and Developers.pptx
 
Mobile App Development Company In Noida | Drona Infotech
Mobile App Development Company In Noida | Drona InfotechMobile App Development Company In Noida | Drona Infotech
Mobile App Development Company In Noida | Drona Infotech
 
Artificia Intellicence and XPath Extension Functions
Artificia Intellicence and XPath Extension FunctionsArtificia Intellicence and XPath Extension Functions
Artificia Intellicence and XPath Extension Functions
 
APIs for Browser Automation (MoT Meetup 2024)
APIs for Browser Automation (MoT Meetup 2024)APIs for Browser Automation (MoT Meetup 2024)
APIs for Browser Automation (MoT Meetup 2024)
 
DDS-Security 1.2 - What's New? Stronger security for long-running systems
DDS-Security 1.2 - What's New? Stronger security for long-running systemsDDS-Security 1.2 - What's New? Stronger security for long-running systems
DDS-Security 1.2 - What's New? Stronger security for long-running systems
 
socradar-q1-2024-aviation-industry-report.pdf
socradar-q1-2024-aviation-industry-report.pdfsocradar-q1-2024-aviation-industry-report.pdf
socradar-q1-2024-aviation-industry-report.pdf
 
Fundamentals of Programming and Language Processors
Fundamentals of Programming and Language ProcessorsFundamentals of Programming and Language Processors
Fundamentals of Programming and Language Processors
 
2024 eCommerceDays Toulouse - Sylius 2.0.pdf
2024 eCommerceDays Toulouse - Sylius 2.0.pdf2024 eCommerceDays Toulouse - Sylius 2.0.pdf
2024 eCommerceDays Toulouse - Sylius 2.0.pdf
 
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOMLORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
 
Enterprise Resource Planning System in Telangana
Enterprise Resource Planning System in TelanganaEnterprise Resource Planning System in Telangana
Enterprise Resource Planning System in Telangana
 
Transform Your Communication with Cloud-Based IVR Solutions
Transform Your Communication with Cloud-Based IVR SolutionsTransform Your Communication with Cloud-Based IVR Solutions
Transform Your Communication with Cloud-Based IVR Solutions
 
Orion Context Broker introduction 20240604
Orion Context Broker introduction 20240604Orion Context Broker introduction 20240604
Orion Context Broker introduction 20240604
 
Hand Rolled Applicative User Validation Code Kata
Hand Rolled Applicative User ValidationCode KataHand Rolled Applicative User ValidationCode Kata
Hand Rolled Applicative User Validation Code Kata
 
Empowering Growth with Best Software Development Company in Noida - Deuglo
Empowering Growth with Best Software  Development Company in Noida - DeugloEmpowering Growth with Best Software  Development Company in Noida - Deuglo
Empowering Growth with Best Software Development Company in Noida - Deuglo
 
SWEBOK and Education at FUSE Okinawa 2024
SWEBOK and Education at FUSE Okinawa 2024SWEBOK and Education at FUSE Okinawa 2024
SWEBOK and Education at FUSE Okinawa 2024
 
Why Choose Odoo 17 Community & How it differs from Odoo 17 Enterprise Edition
Why Choose Odoo 17 Community & How it differs from Odoo 17 Enterprise EditionWhy Choose Odoo 17 Community & How it differs from Odoo 17 Enterprise Edition
Why Choose Odoo 17 Community & How it differs from Odoo 17 Enterprise Edition
 
E-commerce Application Development Company.pdf
E-commerce Application Development Company.pdfE-commerce Application Development Company.pdf
E-commerce Application Development Company.pdf
 

UI5con 2017 - Create your own UI5 controls – what’s coming up

  • 1. Andreas Kunz, SAP SE June 30, 2017 Create Your Own UI5 Controls – What’s Coming Up
  • 2. Disclaimer „What‘s Coming Up“ means:  No guarantees about future features!  What‘s there (control dev in general) has been presented last year:  https://www.slideshare.net/andreaskunz/ui5-controls-ui5con-2016  https://www.youtube.com/watch?v=W3Qkev2yk9w
  • 3. 3 JavaScript file with API, renderer and behavior All-imperative Can create HTML from scratch, but also re-use other controls internally UI5 controls at present
  • 4. 4 More and more “composite controls” are being developed:  Controls that purely consist of other controls, with some additional logic, but no own HTML Composite Controls SearchField (composite control) sap.m.Input sap.m.Button „placeholder“ property „placeholder“ property „press“ event „search“ event„buttonText“ property „text“ property sync sync handle in control code Outer API:
  • 5. 5 Creating composite controls requires lots of error-prone glue code:  Instantiating inner controls (at the right time, and not too often), rendering them, managing lifecycle  Making sure they are properly connected in the control hierarchy (for data models, events, invalidation)  Forwarding outer API properties/aggregations to inner controls and vice versa Could we get rid of all that code?  XMLViews and Fragments are well-established and already used for composing controls.  Just use a Fragment to define the inner controls, add an API and a way to bind inner controls to this API!  voilà: the FragmentControl is born! Why is the standard approach not good enough?
  • 6. 6 Two files:  HelloWorld.js – regular control implementation, with API/metadata part, but without the renderer – inherits from sap.ui.core.FragmentControl  HelloWorld.control.xml – just like a regular XMLView (or rather a Fragment, hence the name) How does a FragmentControl look? Demo Code
  • 7. 7 In FragmentControls, you can bind inner controls to the outer control API. $this: name of model which contains the outer API Mechanism behind this feature is generic and can be used elsewhere: sap.ui.model.base.ManagedObjectModel We‘ll get to it later… Digression: what is $this? ?
  • 8. 8 SearchField Declarative way to map events also being investigated Demo
  • 9. 9 When application should have full control over content added into your FragmentControl:  JS file is trivial, just defines the aggregation:  Use a sap.ui.core.FragmentProxy in XML, as placeholder for controls from outside. Handling Aggregations, Part 1: Using aggregated controls as-provided Demo Code
  • 10. 10 Handling Aggregations, Part 2: Using different controls internally When you want to hide some properties of the internal controls or use different control type:  Fully declare the inner control and bind some properties against the outer aggregation. Example: application should be able to make your control display any number of buttons, but should only control the button text and only get one consolidated event. The binding context in the aggregation template (= the Button) refers to the respective item in the outer aggregation, so the relative path „text“ points to a different outer control for each actual Button. Demo Code
  • 11. 11 FragmentControl is very well-suited for static, always equal control structures. Can use aggregation binding and visibility of inner controls to handle dynamic structure. XML Templating can be an option to:  Handle complex structure decisions declaratively  Set up structure in advance, possibly store result in view cache (performance!) But feels complicated right now… working on it… What if the structure is not always the same?
  • 12. 12 Initially „ControlTreeModel“ and just used for controls within a FragmentControl, then generalized. Makes tree of UI5 controls (or other ManagedObjects) and their properties available as a model . Just do and set the model on a view or control, e.g. as „inputModel“, and you can: CAVEAT: usually don‘t do this in applications! Normally, binding both controls to a separate data model is a cleaner option, but sometimes you don‘t own both controls or don‘t know both models. Coming back to the ManagedObjectModel Demo Code
  • 13. 13 For each ListItem in oList, there will be a Button within the HorizontalLayout. ManagedObjectModel also works for aggregations Demo Code
  • 14. 14 When creating inner controls in init(), bind their properties and aggregations to a ManagedObjectModel you create. ManagedObjectModel in regular composite controls Demo Code …
  • 15. 15 All shown features are available in master branch and 1.48, BUT:  Documentation and APIdoc is hidden  Classes are marked as „private“ Productive use is discouraged because API might change, or entire feature may be removed or renamed! Trying the feature and giving feedback is welcome. No support guarantees.  Source code: https://github.com/SAP/openui5/blob/master/src/sap.ui.core/src/sap/ui/core/FragmentControl.js  Commits: https://github.com/SAP/openui5/search?p=1&q=fragmentcontrol&type=Commits  Nightly: https://openui5nightly.hana.ondemand.com/resources/sap/ui/core/FragmentControl-dbg.js  1.48: https://openui5.hana.ondemand.com/1.48.0/resources/sap/ui/model/base/ManagedObjectModel-dbg.js Caveat: session title includes „what‘s coming up“!
  • 16. 16 FragmentControls are written like XMLView+Controller – but they have an API like controls. Make creating composite controls much easier. The ManagedObjectModel offers the API of a control (or other ManagedObject) as a bindable Model. It is created automatically in FragmentControls, to connect inner controls to the outer API, but can be used for other purposes. FragmentControls and ManagedObjectModel are present in UI5 1.48, but not yet documented and intended for productive use. You can try, but they may change. All code samples: https://github.com/akudev/UI5con2017-ControlDevNews Summary
  • 17. Thank you. Contact information: Andreas Kunz andreas.kunz@sap.com Twitter: @aku_dev You are welcome to give feedback for this session in the UI5con Event App