SlideShare a Scribd company logo
1 of 8
Custom UI5 Controls
Wrapping 3rd-Party Widgets*)
or: How to handle externally-managed HTML inside UI5 controls?
UI5ers live – April 2024
Andreas Kunz, SAP SE
*) like charts, maps, 3D viewers, editors, …
Any Web Widget Be Like…
„…gimme DOM element, I do magic!“
UI5 Rendering
apiVersion 1:
• rm.write("<someTag>bla</someTag>")
• Entire control HTML is removed and re-created from this string
apiVersion 2:
• rm.openStart("someTag") ...
• Control HTML is re-used and patched, but attributes/children added later are removed
apiVersion 4:
• Same, but different, but same: like apiVersion 2, but rendering needs to be independent from
parent control and non-owned HTML
• Control HTML remains untouched even when parent is re-rendered!
• …as long as your control handles all property/aggregation changes without invalidation
• AND parent controls have apiVersion 2+ (granted with UI5 2.x)
• AND any contained child controls have apiVersion 4
• AND any onBefore/AfterRendering event delegates added by application code sets the canSkipRendering flag
• AND maybe some other conditions
BAM!
BAM!
BAM!
sap.ui.core.HTML to the Rescue
Content moved away during rendering and restored afterwards:
Basic usage: https://jsbin.com/ragukag/edit?html,output
Hint: do NOT set different IDs for control and content element! (only one)
Example
OpenStreetMap control using https://leafletjs.com
https://jsbin.com/fibusug/edit?html,output
(based on a sample shown at the very first UI5con)
1
2
3
4
5
What happens exactly?
a) If parent HBox is re-rendered: control DOM is not touched at all, thanks to
apiVersion:4.
With apiVersion:2 or 1, the control is re-rendered and the HTML control does its „preserve“ magic.
b) If „zoom“ property is changed: setZoom(…) prevents invalidation and
updates the map directly – DOM is not touched otherwise.
c) If „latitude“ or “longitude“ property is changed: the control is
invalidated and re-rendered and the HTML control does its „preserve“
magic.
Thank you!
Andreas Kunz

More Related Content

Similar to UI5ers live - Custom Controls wrapping 3rd-party libs.pptx

IBM Lotusphere 2011 AD306 - IBM Lotus Sametime Proxy: A Collaborative Recipe...
IBM Lotusphere 2011 AD306 - IBM Lotus Sametime Proxy:  A Collaborative Recipe...IBM Lotusphere 2011 AD306 - IBM Lotus Sametime Proxy:  A Collaborative Recipe...
IBM Lotusphere 2011 AD306 - IBM Lotus Sametime Proxy: A Collaborative Recipe...William Holmes
 
IBM i Encryption Made Easy
IBM i Encryption Made EasyIBM i Encryption Made Easy
IBM i Encryption Made EasyPrecisely
 
Ivan Danilov «Desktop Application Automation: .NET Developer’s Perspective»
Ivan Danilov «Desktop Application Automation: .NET Developer’s Perspective»Ivan Danilov «Desktop Application Automation: .NET Developer’s Perspective»
Ivan Danilov «Desktop Application Automation: .NET Developer’s Perspective»LogeekNightUkraine
 
Victor Toal - IBM Connections: So you have it installed – now what?
Victor Toal - IBM Connections: So you have it installed – now what?Victor Toal - IBM Connections: So you have it installed – now what?
Victor Toal - IBM Connections: So you have it installed – now what?LetsConnect
 
An Introduction to the Model-View-Controller Pattern
An Introduction to the Model-View-Controller PatternAn Introduction to the Model-View-Controller Pattern
An Introduction to the Model-View-Controller PatternTeamstudio
 
Seal, Personalize and Automate your WVD Images using a validated vendor best ...
Seal, Personalize and Automate your WVD Images using a validated vendor best ...Seal, Personalize and Automate your WVD Images using a validated vendor best ...
Seal, Personalize and Automate your WVD Images using a validated vendor best ...Matthias Schlimm
 
Launching Activiti v6 (Activiti Community Day Paris 2015)
Launching Activiti v6 (Activiti Community Day Paris 2015) Launching Activiti v6 (Activiti Community Day Paris 2015)
Launching Activiti v6 (Activiti Community Day Paris 2015) Joram Barrez
 
IBM Lotus Notes Client Management Done Right – Beginning to End
IBM Lotus Notes Client Management Done Right – Beginning to EndIBM Lotus Notes Client Management Done Right – Beginning to End
IBM Lotus Notes Client Management Done Right – Beginning to Endpanagenda
 
Radu vunvulea building and testing windows 8 metro style applications using ...
Radu vunvulea  building and testing windows 8 metro style applications using ...Radu vunvulea  building and testing windows 8 metro style applications using ...
Radu vunvulea building and testing windows 8 metro style applications using ...Radu Vunvulea
 
Drupal 8 deeper dive
Drupal 8 deeper diveDrupal 8 deeper dive
Drupal 8 deeper diveAmazee Labs
 
Create your own control - UI5Con
Create your own control - UI5ConCreate your own control - UI5Con
Create your own control - UI5ConWouter Lemaire
 
West Coast DevCon 2014: Engine Overview - A Programmers Glimpse at UE4
West Coast DevCon 2014: Engine Overview - A Programmers Glimpse at UE4West Coast DevCon 2014: Engine Overview - A Programmers Glimpse at UE4
West Coast DevCon 2014: Engine Overview - A Programmers Glimpse at UE4Gerke Max Preussner
 
Getting started with Xamarin forms
Getting started with Xamarin formsGetting started with Xamarin forms
Getting started with Xamarin formsSolTech, Inc.
 
Symfony2 for legacy app rejuvenation: the eZ Publish case study
Symfony2 for legacy app rejuvenation: the eZ Publish case studySymfony2 for legacy app rejuvenation: the eZ Publish case study
Symfony2 for legacy app rejuvenation: the eZ Publish case studyGaetano Giunta
 
TomaszPoszytek_ALM-Fundamentals_SS2023.pdf
TomaszPoszytek_ALM-Fundamentals_SS2023.pdfTomaszPoszytek_ALM-Fundamentals_SS2023.pdf
TomaszPoszytek_ALM-Fundamentals_SS2023.pdfTomasz Poszytek
 
AWS re:Invent 2013 - MBL303 Gaming Ops - Running High-performance Ops for Mob...
AWS re:Invent 2013 - MBL303 Gaming Ops - Running High-performance Ops for Mob...AWS re:Invent 2013 - MBL303 Gaming Ops - Running High-performance Ops for Mob...
AWS re:Invent 2013 - MBL303 Gaming Ops - Running High-performance Ops for Mob...Eduardo Saito
 

Similar to UI5ers live - Custom Controls wrapping 3rd-party libs.pptx (20)

44c
44c44c
44c
 
IBM Lotusphere 2011 AD306 - IBM Lotus Sametime Proxy: A Collaborative Recipe...
IBM Lotusphere 2011 AD306 - IBM Lotus Sametime Proxy:  A Collaborative Recipe...IBM Lotusphere 2011 AD306 - IBM Lotus Sametime Proxy:  A Collaborative Recipe...
IBM Lotusphere 2011 AD306 - IBM Lotus Sametime Proxy: A Collaborative Recipe...
 
IBM i Encryption Made Easy
IBM i Encryption Made EasyIBM i Encryption Made Easy
IBM i Encryption Made Easy
 
Ivan Danilov «Desktop Application Automation: .NET Developer’s Perspective»
Ivan Danilov «Desktop Application Automation: .NET Developer’s Perspective»Ivan Danilov «Desktop Application Automation: .NET Developer’s Perspective»
Ivan Danilov «Desktop Application Automation: .NET Developer’s Perspective»
 
Victor Toal - IBM Connections: So you have it installed – now what?
Victor Toal - IBM Connections: So you have it installed – now what?Victor Toal - IBM Connections: So you have it installed – now what?
Victor Toal - IBM Connections: So you have it installed – now what?
 
An Introduction to the Model-View-Controller Pattern
An Introduction to the Model-View-Controller PatternAn Introduction to the Model-View-Controller Pattern
An Introduction to the Model-View-Controller Pattern
 
Seal, Personalize and Automate your WVD Images using a validated vendor best ...
Seal, Personalize and Automate your WVD Images using a validated vendor best ...Seal, Personalize and Automate your WVD Images using a validated vendor best ...
Seal, Personalize and Automate your WVD Images using a validated vendor best ...
 
Building APIs with Mule and Spring Boot
Building APIs with Mule and Spring BootBuilding APIs with Mule and Spring Boot
Building APIs with Mule and Spring Boot
 
Launching Activiti v6 (Activiti Community Day Paris 2015)
Launching Activiti v6 (Activiti Community Day Paris 2015) Launching Activiti v6 (Activiti Community Day Paris 2015)
Launching Activiti v6 (Activiti Community Day Paris 2015)
 
IBM Lotus Notes Client Management Done Right – Beginning to End
IBM Lotus Notes Client Management Done Right – Beginning to EndIBM Lotus Notes Client Management Done Right – Beginning to End
IBM Lotus Notes Client Management Done Right – Beginning to End
 
Radu vunvulea building and testing windows 8 metro style applications using ...
Radu vunvulea  building and testing windows 8 metro style applications using ...Radu vunvulea  building and testing windows 8 metro style applications using ...
Radu vunvulea building and testing windows 8 metro style applications using ...
 
Web Components, O Drupal está preparado?
Web Components, O Drupal está preparado?Web Components, O Drupal está preparado?
Web Components, O Drupal está preparado?
 
Drupal 8 deeper dive
Drupal 8 deeper diveDrupal 8 deeper dive
Drupal 8 deeper dive
 
Create your own control - UI5Con
Create your own control - UI5ConCreate your own control - UI5Con
Create your own control - UI5Con
 
West Coast DevCon 2014: Engine Overview - A Programmers Glimpse at UE4
West Coast DevCon 2014: Engine Overview - A Programmers Glimpse at UE4West Coast DevCon 2014: Engine Overview - A Programmers Glimpse at UE4
West Coast DevCon 2014: Engine Overview - A Programmers Glimpse at UE4
 
3 Review
3 Review3 Review
3 Review
 
Getting started with Xamarin forms
Getting started with Xamarin formsGetting started with Xamarin forms
Getting started with Xamarin forms
 
Symfony2 for legacy app rejuvenation: the eZ Publish case study
Symfony2 for legacy app rejuvenation: the eZ Publish case studySymfony2 for legacy app rejuvenation: the eZ Publish case study
Symfony2 for legacy app rejuvenation: the eZ Publish case study
 
TomaszPoszytek_ALM-Fundamentals_SS2023.pdf
TomaszPoszytek_ALM-Fundamentals_SS2023.pdfTomaszPoszytek_ALM-Fundamentals_SS2023.pdf
TomaszPoszytek_ALM-Fundamentals_SS2023.pdf
 
AWS re:Invent 2013 - MBL303 Gaming Ops - Running High-performance Ops for Mob...
AWS re:Invent 2013 - MBL303 Gaming Ops - Running High-performance Ops for Mob...AWS re:Invent 2013 - MBL303 Gaming Ops - Running High-performance Ops for Mob...
AWS re:Invent 2013 - MBL303 Gaming Ops - Running High-performance Ops for Mob...
 

Recently uploaded

Asset Management Software - Infographic
Asset Management Software - InfographicAsset Management Software - Infographic
Asset Management Software - InfographicHr365.us smith
 
Unveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsUnveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsAhmed Mohamed
 
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...soniya singh
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software DevelopersVinodh Ram
 
EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityNeo4j
 
Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackCloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackVICTOR MAESTRE RAMIREZ
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...gurkirankumar98700
 
Implementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureImplementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureDinusha Kumarasiri
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...MyIntelliSource, Inc.
 
What is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWhat is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWave PLM
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantAxelRicardoTrocheRiq
 
The Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdfThe Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdfPower Karaoke
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...MyIntelliSource, Inc.
 
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样umasea
 
React Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaReact Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaHanief Utama
 
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024StefanoLambiase
 
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfGOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfAlina Yurenko
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideChristina Lin
 

Recently uploaded (20)

Asset Management Software - Infographic
Asset Management Software - InfographicAsset Management Software - Infographic
Asset Management Software - Infographic
 
Unveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsUnveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML Diagrams
 
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software Developers
 
EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered Sustainability
 
Hot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort Service
Hot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort ServiceHot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort Service
Hot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort Service
 
Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackCloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStack
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
 
Implementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureImplementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with Azure
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
 
What is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWhat is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need It
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service Consultant
 
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
 
The Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdfThe Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdf
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
 
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
 
React Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaReact Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief Utama
 
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
 
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfGOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
 

UI5ers live - Custom Controls wrapping 3rd-party libs.pptx

  • 1. Custom UI5 Controls Wrapping 3rd-Party Widgets*) or: How to handle externally-managed HTML inside UI5 controls? UI5ers live – April 2024 Andreas Kunz, SAP SE *) like charts, maps, 3D viewers, editors, …
  • 2. Any Web Widget Be Like… „…gimme DOM element, I do magic!“
  • 3. UI5 Rendering apiVersion 1: • rm.write("<someTag>bla</someTag>") • Entire control HTML is removed and re-created from this string apiVersion 2: • rm.openStart("someTag") ... • Control HTML is re-used and patched, but attributes/children added later are removed apiVersion 4: • Same, but different, but same: like apiVersion 2, but rendering needs to be independent from parent control and non-owned HTML • Control HTML remains untouched even when parent is re-rendered! • …as long as your control handles all property/aggregation changes without invalidation • AND parent controls have apiVersion 2+ (granted with UI5 2.x) • AND any contained child controls have apiVersion 4 • AND any onBefore/AfterRendering event delegates added by application code sets the canSkipRendering flag • AND maybe some other conditions BAM! BAM! BAM!
  • 4. sap.ui.core.HTML to the Rescue Content moved away during rendering and restored afterwards: Basic usage: https://jsbin.com/ragukag/edit?html,output Hint: do NOT set different IDs for control and content element! (only one)
  • 5. Example OpenStreetMap control using https://leafletjs.com https://jsbin.com/fibusug/edit?html,output (based on a sample shown at the very first UI5con)
  • 7. What happens exactly? a) If parent HBox is re-rendered: control DOM is not touched at all, thanks to apiVersion:4. With apiVersion:2 or 1, the control is re-rendered and the HTML control does its „preserve“ magic. b) If „zoom“ property is changed: setZoom(…) prevents invalidation and updates the map directly – DOM is not touched otherwise. c) If „latitude“ or “longitude“ property is changed: the control is invalidated and re-rendered and the HTML control does its „preserve“ magic.

Editor's Notes

  1. https://jsbin.com/fibusug/edit?html,output (full sample) Simple: https://jsbin.com/bizahik/edit?html,output