SlideShare a Scribd company logo
1 of 23
Download to read offline
Andreas Kunz & Thomas Gauguin Houghton-Larsen, SAP SE
June 22, 2018
News from
Control Development
Disclaimer
„News“ means: we will not talk about control development basics
 UI5con 2016:
 https://www.slideshare.net/andreaskunz/ui5-controls-ui5con-2016
 https://www.youtube.com/watch?v=W3Qkev2yk9w
 16:05 h in Room B:
„Create your own UI5 Control, wrap it in a library and consume it“
3
JavaScript file with API, renderer and
behavior
All-imperative
Can create HTML from scratch, but
can 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)
▪ Sync of outer API properties / aggregations with inner controls
▪ No visualization of the final control layout
How can we address these challenges ?
▪ XMLViews and Fragments are well-established and already used for combining controls
▪ XMLViews have proven to make their inner structure easily understandable
▪ Just use a Fragment to define the inner controls, add an API, and a way to bind inner controls to this API !
 voilà: the XMLComposite control is born!
Note: “FragmentControl” was a preliminary working title of the XMLComposite (preview at UI5con@SAP 2017)
Why is the standard approach not good enough?
6
Pair of files:
▪ HelloWorld.js
– regular control implementation, with API/metadata part, but without the renderer
– inherits from sap.ui.core.XMLComposite
▪ HelloWorld.control.xml
– just like a regular XMLView (or rather an XML Fragment) + $this ….
How does an XMLComposite control look?
Demo Code
7
In XMLComposites, 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 (e.g. in regular composite
controls without XML): sap.ui.model.base.ManagedObjectModel
We‘ll get to it later…
Digression: what is $this?
8
SearchField
Demo
Code
9
Handling Aggregations: 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 inner
Button.
DemoCode
10
Makes properties and aggregations of a UI5 control (or a ManagedObject) available as a model.
Just do
and set the model on a view or control, e.g. as „inputModel“, and you can:
Note: Usually, this additional level of indirection makes less sense if an application has the models
and the Controls at its disposal.
Coming back to the ManagedObjectModel
Demo Code
11
For each ListItem in oList, there will be a Button within the HorizontalLayout.
ManagedObjectModel also works for aggregations
Demo Code
12
Example: a new composite container control uses a Panel internally for expand/collapse.
All controls in „content“ aggregation should be displayed inside this Panel.
What if we just want to re-use the same control somewhere inside?
my.Container (composite control)
sap.m.Panel
„content“ aggregation
Outer API:
13
Composite controls can define an aggregation to be forwarded to an internal child control:
metadata : { // "my.Container" API
aggregations : {
content: {
type: "sap.ui.core.Control",
multiple: true,
forwarding: {
idSuffix: "-panel",
aggregation: "content"
}
},
...
init: function() {
var oPanel = new sap.m.Panel(this.getId() + "-panel", { ... });
Demo Playground Demo
Aggregation Forwarding
14
forwarding: {
getter: "getPanel",
aggregation: "content"
}
...
getPanel: function() {
// if not yet created:
var oPanel = new sap.m.Panel({ ... });
...
return oPanel;
}
Demo
Aggregation Forwarding – create inner control lazily
15
Aggregation Forwarding in XMLComposites
Demo Code
Even easier:
<!– somewhere in the XML Fragment: -->
<Panel id="panel" headerText="Inner Panel" expandable="true" />
<!-- controls given into the "content" aggregation will be forwarded in here -->
content: {
type: "sap.ui.core.Control",
multiple: true,
forwarding: {
idSuffix: "--panel",
aggregation: "content"
}
...
16
Have you ever written XMLView & Controller code like this?
<Button text="-10" press=".minus10" />
<Button text="-" press=".minus1" />
<Button text="+" press=".plus1" />
<Button text="+10" press=".plus10" />
And now for something completely different…
17
Then you‘ll love this:
<Button text="-10" press=".changeBy(-10)" />
<Button text="-" press=".changeBy(-1)" />
<Button text="+" press=".changeBy(1)" />
<Button text="+10" press=".changeBy(10)" />
Event Handler Parameters
18
…and probably also this:
<Button text="Calculate Tax" press=".calcTax(${unitPrice}, ${taxCategory})" />
▪ Accessing model data with binding statements, according to current data context
<ColorPalette colorSelect=".setColor(${$parameters>/value})" />
<Button text="Tell Me" press=".doSomething(${$source>/text})" />
▪ Keeping knowledge about controls away from controller code
<Button text="Greet Me!" press="sap.m.MessageBox.show('Hello!')" />
▪ Calling static functions directly, without a controller method
$event is the event object, $controller is the controller
Evaluated as a Binding Expression.
Event Handler Parameters
Playground Demo Table Demo
19
Event parameters can be used in XMLViews, but also in XMLComposites.
<core:FragmentDefinition xmlns="sap.m" xmlns:core="sap.ui.core" xmlns:layout="sap.ui.layout">
<layout:HorizontalLayout>
<Button text="-10" press=".changeBy(-10)" />
<Button text="-" press=".changeBy(-1)" />
<Input value="{$this>/page}" editable="false" />
<Button text="+" press=".changeBy(1)" />
<Button text="+10" press=".changeBy(10)" />
</layout:HorizontalLayout>
</core:FragmentDefinition>
…something completely different? Maybe not.
Demo XML Code JS Code
20
...
<Input id="innerInput" />
<Button text="{$this>/buttonText}"
press=".fireEvent('search', {value: $controller.byId('innerInput').getValue()})"/>
...
Use with moderation…
Or in the SearchField XMLComposite shown earlier
21
XMLComposite controls are written like XMLView + Controller – but they have an API like
regular controls. They make creating composite controls much easier.
The ManagedObjectModel offers the properties & aggregations of a control (or other
ManagedObject) as a bindable Model. It is automatically provided in XMLComposites.
Aggregation Forwarding can be used to declare that every control put into an aggregation of
a composite shall be forwarded to an inner control.
Event Handler Parameters can now be specified in XMLViews and XMLComposites.
Summary
22
All features are in UI5 1.56
▪ XMLComposites & ManagedObjectModel earlier, but improved now
▪ ManagedObjectModel only publicly documented in 1.58
▪ Still sort of experimental
Code samples: https://github.com/akudev/UI5con2018-ControlDevNews
Documentation (openui5nightly, as 1.56 is not yet released):
▪ XML Composite Controls
▪ ManagedObjectModel
▪ Aggregation Forwarding
▪ Handling Events in XML Views
Resources
Thank you.
Contact information:
Andreas Kunz
@aku_dev
Thomas Gauguin Houghton-Larsen

More Related Content

What's hot

Firebase Introduction
Firebase Introduction Firebase Introduction
Firebase Introduction 9xdot
 
Fastlane - Automation and Continuous Delivery for iOS Apps
Fastlane - Automation and Continuous Delivery for iOS AppsFastlane - Automation and Continuous Delivery for iOS Apps
Fastlane - Automation and Continuous Delivery for iOS AppsSarath C
 
Build and release iOS apps using Fastlane tools
Build and release iOS apps using Fastlane toolsBuild and release iOS apps using Fastlane tools
Build and release iOS apps using Fastlane toolsWise Engineering
 
Android Data Binding in action using MVVM pattern - droidconUK
Android Data Binding in action using MVVM pattern - droidconUKAndroid Data Binding in action using MVVM pattern - droidconUK
Android Data Binding in action using MVVM pattern - droidconUKFabio Collini
 
Query Operation in Microsoft SharePoint using Mule ESB
Query Operation in Microsoft SharePoint using Mule ESBQuery Operation in Microsoft SharePoint using Mule ESB
Query Operation in Microsoft SharePoint using Mule ESBSanjeet Pandey
 
Podman - The Next Generation of Linux Container Tools
Podman - The Next Generation of Linux Container ToolsPodman - The Next Generation of Linux Container Tools
Podman - The Next Generation of Linux Container ToolsI Putu Hariyadi
 
Top 10 Mobile Application Testing Tools | Edureka
Top 10 Mobile Application Testing Tools | EdurekaTop 10 Mobile Application Testing Tools | Edureka
Top 10 Mobile Application Testing Tools | EdurekaEdureka!
 
Top 11 Mobile App Development Frameworks
Top 11 Mobile App Development FrameworksTop 11 Mobile App Development Frameworks
Top 11 Mobile App Development FrameworksAlbiorix Technology
 
Getting started with GitHub Desktop
Getting started with GitHub DesktopGetting started with GitHub Desktop
Getting started with GitHub DesktopAram Panasenco
 
Selenium IDE Tutorial For Beginners | Selenium IDE Tutorial | What Is Seleniu...
Selenium IDE Tutorial For Beginners | Selenium IDE Tutorial | What Is Seleniu...Selenium IDE Tutorial For Beginners | Selenium IDE Tutorial | What Is Seleniu...
Selenium IDE Tutorial For Beginners | Selenium IDE Tutorial | What Is Seleniu...Simplilearn
 
What is new in Firebase?
What is new in Firebase?What is new in Firebase?
What is new in Firebase?Sinan Yılmaz
 

What's hot (20)

Firebase Introduction
Firebase Introduction Firebase Introduction
Firebase Introduction
 
Fastlane - Automation and Continuous Delivery for iOS Apps
Fastlane - Automation and Continuous Delivery for iOS AppsFastlane - Automation and Continuous Delivery for iOS Apps
Fastlane - Automation and Continuous Delivery for iOS Apps
 
Firebase
FirebaseFirebase
Firebase
 
Google Firebase presentation - English
Google Firebase presentation - EnglishGoogle Firebase presentation - English
Google Firebase presentation - English
 
Build and release iOS apps using Fastlane tools
Build and release iOS apps using Fastlane toolsBuild and release iOS apps using Fastlane tools
Build and release iOS apps using Fastlane tools
 
Android Data Binding in action using MVVM pattern - droidconUK
Android Data Binding in action using MVVM pattern - droidconUKAndroid Data Binding in action using MVVM pattern - droidconUK
Android Data Binding in action using MVVM pattern - droidconUK
 
Query Operation in Microsoft SharePoint using Mule ESB
Query Operation in Microsoft SharePoint using Mule ESBQuery Operation in Microsoft SharePoint using Mule ESB
Query Operation in Microsoft SharePoint using Mule ESB
 
Yii framework
Yii frameworkYii framework
Yii framework
 
Podman - The Next Generation of Linux Container Tools
Podman - The Next Generation of Linux Container ToolsPodman - The Next Generation of Linux Container Tools
Podman - The Next Generation of Linux Container Tools
 
Top 10 Mobile Application Testing Tools | Edureka
Top 10 Mobile Application Testing Tools | EdurekaTop 10 Mobile Application Testing Tools | Edureka
Top 10 Mobile Application Testing Tools | Edureka
 
Selenium-4
Selenium-4Selenium-4
Selenium-4
 
Introduction to Firebase from Google
Introduction to Firebase from GoogleIntroduction to Firebase from Google
Introduction to Firebase from Google
 
Top 11 Mobile App Development Frameworks
Top 11 Mobile App Development FrameworksTop 11 Mobile App Development Frameworks
Top 11 Mobile App Development Frameworks
 
Getting started with GitHub Desktop
Getting started with GitHub DesktopGetting started with GitHub Desktop
Getting started with GitHub Desktop
 
Geolocalisation
GeolocalisationGeolocalisation
Geolocalisation
 
Test automation using selenium
Test automation using seleniumTest automation using selenium
Test automation using selenium
 
Selenium IDE Tutorial For Beginners | Selenium IDE Tutorial | What Is Seleniu...
Selenium IDE Tutorial For Beginners | Selenium IDE Tutorial | What Is Seleniu...Selenium IDE Tutorial For Beginners | Selenium IDE Tutorial | What Is Seleniu...
Selenium IDE Tutorial For Beginners | Selenium IDE Tutorial | What Is Seleniu...
 
Google closure compiler
Google closure compilerGoogle closure compiler
Google closure compiler
 
Bitbucket
BitbucketBitbucket
Bitbucket
 
What is new in Firebase?
What is new in Firebase?What is new in Firebase?
What is new in Firebase?
 

Similar to UI5con 2018: News from Control Development

UI5con 2017 - Create your own UI5 controls – what’s coming up
UI5con 2017 - Create your own UI5 controls – what’s coming upUI5con 2017 - Create your own UI5 controls – what’s coming up
UI5con 2017 - Create your own UI5 controls – what’s coming upAndreas Kunz
 
Controller in AngularJS
Controller in AngularJSController in AngularJS
Controller in AngularJSBrajesh Yadav
 
Introduction to Palm's Mojo SDK
Introduction to Palm's Mojo SDKIntroduction to Palm's Mojo SDK
Introduction to Palm's Mojo SDKBrendan Lim
 
Nagios Conference 2013 - Jake Omann - Developing Nagios XI Components and Wiz...
Nagios Conference 2013 - Jake Omann - Developing Nagios XI Components and Wiz...Nagios Conference 2013 - Jake Omann - Developing Nagios XI Components and Wiz...
Nagios Conference 2013 - Jake Omann - Developing Nagios XI Components and Wiz...Nagios
 
Ctools presentation
Ctools presentationCtools presentation
Ctools presentationDigitaria
 
Java Web Programming [8/9] : JSF and AJAX
Java Web Programming [8/9] : JSF and AJAXJava Web Programming [8/9] : JSF and AJAX
Java Web Programming [8/9] : JSF and AJAXIMC Institute
 
SynapseIndia creating asp controls programatically development
SynapseIndia creating asp controls programatically developmentSynapseIndia creating asp controls programatically development
SynapseIndia creating asp controls programatically developmentSynapseindiappsdevelopment
 
Using prime[31] to connect your unity game to azure mobile services
Using prime[31] to connect your unity game to azure mobile servicesUsing prime[31] to connect your unity game to azure mobile services
Using prime[31] to connect your unity game to azure mobile servicesDavid Voyles
 
netmind - Primer Contacto con el Desarrollo de Aplicaciones para Windows 8
netmind - Primer Contacto con el Desarrollo de Aplicaciones para Windows 8netmind - Primer Contacto con el Desarrollo de Aplicaciones para Windows 8
netmind - Primer Contacto con el Desarrollo de Aplicaciones para Windows 8netmind
 
Spark IT 2011 - Simplified Web Development using Java Server Faces 2.0
Spark IT 2011 - Simplified Web Development using Java Server Faces 2.0Spark IT 2011 - Simplified Web Development using Java Server Faces 2.0
Spark IT 2011 - Simplified Web Development using Java Server Faces 2.0Arun Gupta
 
Building Multi-Tenant and SaaS products in PHP - CloudConf 2015
Building Multi-Tenant and SaaS products in PHP - CloudConf 2015Building Multi-Tenant and SaaS products in PHP - CloudConf 2015
Building Multi-Tenant and SaaS products in PHP - CloudConf 2015Innomatic Platform
 
Introduction to the INTEGRAL FRAMEWORK
Introduction to the INTEGRAL FRAMEWORKIntroduction to the INTEGRAL FRAMEWORK
Introduction to the INTEGRAL FRAMEWORKKarthik Subramanian
 
Introduction to the integral framework
Introduction to the integral frameworkIntroduction to the integral framework
Introduction to the integral frameworkKarthik Subramanian
 
Leture5 exercise onactivities
Leture5 exercise onactivitiesLeture5 exercise onactivities
Leture5 exercise onactivitiesmaamir farooq
 
Lecture exercise on activities
Lecture exercise on activitiesLecture exercise on activities
Lecture exercise on activitiesmaamir farooq
 
Steps how to create active x using visual studio 2008
Steps how to create active x using visual studio 2008Steps how to create active x using visual studio 2008
Steps how to create active x using visual studio 2008Yudep Apoi
 
XPages Blast - ILUG 2010
XPages Blast - ILUG 2010XPages Blast - ILUG 2010
XPages Blast - ILUG 2010Tim Clark
 
Working With The Symfony Admin Generator
Working With The Symfony Admin GeneratorWorking With The Symfony Admin Generator
Working With The Symfony Admin GeneratorJohn Cleveley
 

Similar to UI5con 2018: News from Control Development (20)

UI5con 2017 - Create your own UI5 controls – what’s coming up
UI5con 2017 - Create your own UI5 controls – what’s coming upUI5con 2017 - Create your own UI5 controls – what’s coming up
UI5con 2017 - Create your own UI5 controls – what’s coming up
 
Eclipse Tricks
Eclipse TricksEclipse Tricks
Eclipse Tricks
 
Controller in AngularJS
Controller in AngularJSController in AngularJS
Controller in AngularJS
 
Introduction to Palm's Mojo SDK
Introduction to Palm's Mojo SDKIntroduction to Palm's Mojo SDK
Introduction to Palm's Mojo SDK
 
Nagios Conference 2013 - Jake Omann - Developing Nagios XI Components and Wiz...
Nagios Conference 2013 - Jake Omann - Developing Nagios XI Components and Wiz...Nagios Conference 2013 - Jake Omann - Developing Nagios XI Components and Wiz...
Nagios Conference 2013 - Jake Omann - Developing Nagios XI Components and Wiz...
 
Ctools presentation
Ctools presentationCtools presentation
Ctools presentation
 
Java Web Programming [8/9] : JSF and AJAX
Java Web Programming [8/9] : JSF and AJAXJava Web Programming [8/9] : JSF and AJAX
Java Web Programming [8/9] : JSF and AJAX
 
SynapseIndia creating asp controls programatically development
SynapseIndia creating asp controls programatically developmentSynapseIndia creating asp controls programatically development
SynapseIndia creating asp controls programatically development
 
Using prime[31] to connect your unity game to azure mobile services
Using prime[31] to connect your unity game to azure mobile servicesUsing prime[31] to connect your unity game to azure mobile services
Using prime[31] to connect your unity game to azure mobile services
 
netmind - Primer Contacto con el Desarrollo de Aplicaciones para Windows 8
netmind - Primer Contacto con el Desarrollo de Aplicaciones para Windows 8netmind - Primer Contacto con el Desarrollo de Aplicaciones para Windows 8
netmind - Primer Contacto con el Desarrollo de Aplicaciones para Windows 8
 
Spark IT 2011 - Simplified Web Development using Java Server Faces 2.0
Spark IT 2011 - Simplified Web Development using Java Server Faces 2.0Spark IT 2011 - Simplified Web Development using Java Server Faces 2.0
Spark IT 2011 - Simplified Web Development using Java Server Faces 2.0
 
Building Multi-Tenant and SaaS products in PHP - CloudConf 2015
Building Multi-Tenant and SaaS products in PHP - CloudConf 2015Building Multi-Tenant and SaaS products in PHP - CloudConf 2015
Building Multi-Tenant and SaaS products in PHP - CloudConf 2015
 
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
 
Java script
Java scriptJava script
Java script
 
Leture5 exercise onactivities
Leture5 exercise onactivitiesLeture5 exercise onactivities
Leture5 exercise onactivities
 
Lecture exercise on activities
Lecture exercise on activitiesLecture exercise on activities
Lecture exercise on activities
 
Steps how to create active x using visual studio 2008
Steps how to create active x using visual studio 2008Steps how to create active x using visual studio 2008
Steps how to create active x using visual studio 2008
 
XPages Blast - ILUG 2010
XPages Blast - ILUG 2010XPages Blast - ILUG 2010
XPages Blast - ILUG 2010
 
Working With The Symfony Admin Generator
Working With The Symfony Admin GeneratorWorking With The Symfony Admin Generator
Working With The Symfony Admin Generator
 

Recently uploaded

Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsAlberto González Trastoy
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsArshad QA
 
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
Direct Style Effect Systems -The Print[A] Example- A Comprehension AidDirect Style Effect Systems -The Print[A] Example- A Comprehension Aid
Direct Style Effect Systems - The Print[A] Example - A Comprehension AidPhilip Schwarz
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfkalichargn70th171
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdfWave PLM
 
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) SolutionIntroducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) SolutionOnePlan Solutions
 
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM TechniquesAI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM TechniquesVictorSzoltysek
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providermohitmore19
 
Define the academic and professional writing..pdf
Define the academic and professional writing..pdfDefine the academic and professional writing..pdf
Define the academic and professional writing..pdfPearlKirahMaeRagusta1
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...ICS
 
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdfintroduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdfVishalKumarJha10
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...panagenda
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsAndolasoft Inc
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionSolGuruz
 
AI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplateAI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplatePresentation.STUDIO
 
Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdf
Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdfAzure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdf
Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdfryanfarris8
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...Health
 
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...kalichargn70th171
 

Recently uploaded (20)

Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
Direct Style Effect Systems -The Print[A] Example- A Comprehension AidDirect Style Effect Systems -The Print[A] Example- A Comprehension Aid
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf
 
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) SolutionIntroducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
 
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM TechniquesAI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 
Define the academic and professional writing..pdf
Define the academic and professional writing..pdfDefine the academic and professional writing..pdf
Define the academic and professional writing..pdf
 
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdfintroduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.js
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with Precision
 
AI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplateAI & Machine Learning Presentation Template
AI & Machine Learning Presentation Template
 
Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdf
Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdfAzure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdf
Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdf
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
 
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
 

UI5con 2018: News from Control Development

  • 1. Andreas Kunz & Thomas Gauguin Houghton-Larsen, SAP SE June 22, 2018 News from Control Development
  • 2. Disclaimer „News“ means: we will not talk about control development basics  UI5con 2016:  https://www.slideshare.net/andreaskunz/ui5-controls-ui5con-2016  https://www.youtube.com/watch?v=W3Qkev2yk9w  16:05 h in Room B: „Create your own UI5 Control, wrap it in a library and consume it“
  • 3. 3 JavaScript file with API, renderer and behavior All-imperative Can create HTML from scratch, but can 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) ▪ Sync of outer API properties / aggregations with inner controls ▪ No visualization of the final control layout How can we address these challenges ? ▪ XMLViews and Fragments are well-established and already used for combining controls ▪ XMLViews have proven to make their inner structure easily understandable ▪ Just use a Fragment to define the inner controls, add an API, and a way to bind inner controls to this API !  voilà: the XMLComposite control is born! Note: “FragmentControl” was a preliminary working title of the XMLComposite (preview at UI5con@SAP 2017) Why is the standard approach not good enough?
  • 6. 6 Pair of files: ▪ HelloWorld.js – regular control implementation, with API/metadata part, but without the renderer – inherits from sap.ui.core.XMLComposite ▪ HelloWorld.control.xml – just like a regular XMLView (or rather an XML Fragment) + $this …. How does an XMLComposite control look? Demo Code
  • 7. 7 In XMLComposites, 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 (e.g. in regular composite controls without XML): sap.ui.model.base.ManagedObjectModel We‘ll get to it later… Digression: what is $this?
  • 9. 9 Handling Aggregations: 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 inner Button. DemoCode
  • 10. 10 Makes properties and aggregations of a UI5 control (or a ManagedObject) available as a model. Just do and set the model on a view or control, e.g. as „inputModel“, and you can: Note: Usually, this additional level of indirection makes less sense if an application has the models and the Controls at its disposal. Coming back to the ManagedObjectModel Demo Code
  • 11. 11 For each ListItem in oList, there will be a Button within the HorizontalLayout. ManagedObjectModel also works for aggregations Demo Code
  • 12. 12 Example: a new composite container control uses a Panel internally for expand/collapse. All controls in „content“ aggregation should be displayed inside this Panel. What if we just want to re-use the same control somewhere inside? my.Container (composite control) sap.m.Panel „content“ aggregation Outer API:
  • 13. 13 Composite controls can define an aggregation to be forwarded to an internal child control: metadata : { // "my.Container" API aggregations : { content: { type: "sap.ui.core.Control", multiple: true, forwarding: { idSuffix: "-panel", aggregation: "content" } }, ... init: function() { var oPanel = new sap.m.Panel(this.getId() + "-panel", { ... }); Demo Playground Demo Aggregation Forwarding
  • 14. 14 forwarding: { getter: "getPanel", aggregation: "content" } ... getPanel: function() { // if not yet created: var oPanel = new sap.m.Panel({ ... }); ... return oPanel; } Demo Aggregation Forwarding – create inner control lazily
  • 15. 15 Aggregation Forwarding in XMLComposites Demo Code Even easier: <!– somewhere in the XML Fragment: --> <Panel id="panel" headerText="Inner Panel" expandable="true" /> <!-- controls given into the "content" aggregation will be forwarded in here --> content: { type: "sap.ui.core.Control", multiple: true, forwarding: { idSuffix: "--panel", aggregation: "content" } ...
  • 16. 16 Have you ever written XMLView & Controller code like this? <Button text="-10" press=".minus10" /> <Button text="-" press=".minus1" /> <Button text="+" press=".plus1" /> <Button text="+10" press=".plus10" /> And now for something completely different…
  • 17. 17 Then you‘ll love this: <Button text="-10" press=".changeBy(-10)" /> <Button text="-" press=".changeBy(-1)" /> <Button text="+" press=".changeBy(1)" /> <Button text="+10" press=".changeBy(10)" /> Event Handler Parameters
  • 18. 18 …and probably also this: <Button text="Calculate Tax" press=".calcTax(${unitPrice}, ${taxCategory})" /> ▪ Accessing model data with binding statements, according to current data context <ColorPalette colorSelect=".setColor(${$parameters>/value})" /> <Button text="Tell Me" press=".doSomething(${$source>/text})" /> ▪ Keeping knowledge about controls away from controller code <Button text="Greet Me!" press="sap.m.MessageBox.show('Hello!')" /> ▪ Calling static functions directly, without a controller method $event is the event object, $controller is the controller Evaluated as a Binding Expression. Event Handler Parameters Playground Demo Table Demo
  • 19. 19 Event parameters can be used in XMLViews, but also in XMLComposites. <core:FragmentDefinition xmlns="sap.m" xmlns:core="sap.ui.core" xmlns:layout="sap.ui.layout"> <layout:HorizontalLayout> <Button text="-10" press=".changeBy(-10)" /> <Button text="-" press=".changeBy(-1)" /> <Input value="{$this>/page}" editable="false" /> <Button text="+" press=".changeBy(1)" /> <Button text="+10" press=".changeBy(10)" /> </layout:HorizontalLayout> </core:FragmentDefinition> …something completely different? Maybe not. Demo XML Code JS Code
  • 20. 20 ... <Input id="innerInput" /> <Button text="{$this>/buttonText}" press=".fireEvent('search', {value: $controller.byId('innerInput').getValue()})"/> ... Use with moderation… Or in the SearchField XMLComposite shown earlier
  • 21. 21 XMLComposite controls are written like XMLView + Controller – but they have an API like regular controls. They make creating composite controls much easier. The ManagedObjectModel offers the properties & aggregations of a control (or other ManagedObject) as a bindable Model. It is automatically provided in XMLComposites. Aggregation Forwarding can be used to declare that every control put into an aggregation of a composite shall be forwarded to an inner control. Event Handler Parameters can now be specified in XMLViews and XMLComposites. Summary
  • 22. 22 All features are in UI5 1.56 ▪ XMLComposites & ManagedObjectModel earlier, but improved now ▪ ManagedObjectModel only publicly documented in 1.58 ▪ Still sort of experimental Code samples: https://github.com/akudev/UI5con2018-ControlDevNews Documentation (openui5nightly, as 1.56 is not yet released): ▪ XML Composite Controls ▪ ManagedObjectModel ▪ Aggregation Forwarding ▪ Handling Events in XML Views Resources
  • 23. Thank you. Contact information: Andreas Kunz @aku_dev Thomas Gauguin Houghton-Larsen