SlideShare a Scribd company logo
Cahit Gürgüc, SAP SE
June 22, 2018
Drag & Drop
Concept in UI5
2
Drag & Drop – Fiori Launchpad
3
Drag & Drop – Overview Page
4
Drag & Drop – Browse & Collect Pattern
5
High Level Decision
6
UIArea
preprocessEvent
postprocessEvent
Element
dragDropConfig
aggregation
DragAndDrop
(enhance browser events)plugs in event handling
Standard Browser Events:
• dragstart
• dragenter
• dragover
• dragleave
• dragend
• drop
PLUS:
• Consistent across browsers
• DragSession (data transfer)
• Enhanced ghost (+badge)
• Visual style for source/target
DragDropInfo
[sourceAggregation]
[targetAggregation]
[targetElement]
drop event
dragEnter event
DragSession
Simple config for standard use-cases:
• Specifies source + target
• Declarative, bindable
• Allows providing ACC alternatives
• Event driven
0..n
BrowserEventLevelControlLevel
RenderManager
("draggable" attribute)
writeElementData
7
• DragDropInfo can be used when the drag source and the drop target are tightly
coupled and both are known.
• DragInfo can be used just to allow dragging when drop target is not known or
not owned.
• DropInfo can be used as a general drop target.
Config Types - Overview
8
Config Types - Details
DragDropInfo
[targetElement=parent]
(0..1)
[sourceAggregation]
[targetAggregation]
[dropEffect="Move"]
[dropPosition="On"]
dragStart
dragEnter
dragOver
drop
dragEnd
DragInfo
[sourceAggregation]
[groupName]
dragStart
dragEnd
DropInfo
[targetAggregation]
[groupName]
[dropEffect="Move"]
[dropPosition="On"]
dragEnter
dragOver
drop(tightly coupled cases)
(loosely coupled cases)
connected
9
Drag & Drop Use-Cases
Within controls:
• Re-ordering a List
• Moving items within Tree
• Re-ordering IconTabBar Tabs
Between controls:
• Moving items between two lists (browse-and-collect)
• Moving items of any kind to Co-Pilot to do something with the associated data
Outside the browser:
• Drag any piece of text or html or so into the browser
• Drag a file into the browser
• Drag some data out of a Table into an Excel file
• Drag some data to a local file
DragInfo
DragDropInfo
DropInfo
DragDropInfo
DragDropInfo
DragDropInfo
DropInfo
DragInfo
DragInfo
10
<List headerText="Drag my items">
<dragDropConfig>
<dnd:DragDropInfo
sourceAggregation="items"
targetElement="otherList"
drop="handleDrop" />
</dragDropConfig>
<items>
<StandardListItem ... />
</items>
</List>
<List headerText="Drop here" id="otherList">
...
</List>
Example 1: Drag from one List to another List
Plus "do the needful" in
Controller.handleDrop()
11
Example 2: Reordering List Items
<List headerText="Reorder my items">
<dragDropConfig>
<dnd:DragDropInfo
sourceAggregation="items"
targetAggregation="items"
drop="handleReorder" />
</dragDropConfig>
<items>
<StandardListItem ... />
</items>
</List>
Plus "do the needful" in
Controller.handleReorder()
12
Drag from known source to known target:
 Just specify source and "targetElement" in the DragDropInfo and handle the "drop" event
Loosely coupled drag&drop (e.g. multiple/dynamic sources or targets):
 Specify DragInfos and DropInfos with same "groupName" and handle "drop" event
Drag with unknown/external target (other view, FLP, outside browser):
 Specify DragInfo, add suitable data, optionally add predefined "groupName" for the target
Receive from unknown/external source (other view, FLP, file system):
 Specify DropInfo, optionally an expected "groupName", handle "drop" event, but validate transferred
data! Anything unexpected may come in!
Programming Model – Use Cases
13
Copy vs Move vs Link:
 Set "dropEffect" on DropInfo/DragDropInfo
"Drop On" vs "Insert Between":
 Set "dropPosition" property of DropInfo/DragDropInfo
Transferring data: (caveat: not all options are available in all browsers)
 Either access source control in "drop" event, if well-known
 Or use "setData", "setTextData", "setComplexData" via DragSession on "dragstart" event
Programming Model – Further Options
14
Not all items should be dragged:
 Handle "dragstart" event on DragInfo and prevent default of the event.
Not all items are valid drop targets:
 Handle "dragenter" event on DropInfo and prevent the default of the event.
One can drop into some targets, but between other targets:
 Handle "dragenter" event on DropInfo and set "dropPosition" accordingly
Programming Model – Special Handling
15
If the offered configuration is not flexible enough:
 Just use the standard drag&drop events
 They are still enhanced by UI5 to provide proper ghost images etc.
To make drag&drop work across all devices/platforms
 Do not use any native browser features – because they do not work in some browsers or are not
available at all (e.g. no native drag&drop on touch devices)
 Only use Drag/DropInfo configuration and the DragSession object APIs
To make drag&drop accessible for non-mouse-users
 Only use Drag/DropInfo configuration and the DragSession object APIs
Programming Model – Fundemantals
16
Live Coding
17
Control.extend('my.CustomControl', {
metadata : {
properties : {
value : { type : 'string' },
width : { type : 'sap.ui.core.CSSSize', defaultValue : 'auto' }
},
dnd : { draggable: false, droppable: true },
aggregations : {
header : { type : "sap.ui.core.Control", multiple : false, dnd : false },
items : { type: 'sap.ui.core.Control', multiple : true, selector : "#{id}-items", dnd : {
draggable: true, dropppable: true, layout: "Horizontal"
} },
}
}
Metadata
18
19
• There is no mobile device that supports drag and drop. Polyfill is planned.
• Transparency of the drag ghost element and the cursor during drag-and-drop
operations are not configurable.
• Setting constraints on drag position is not possible.
• Texts in draggable controls cannot be selected.
• IE11 only supports plain text MIME type for the DataTransfer Object. Also
defining a custom drag ghost is not possible.
Limitations
20
Drag & Drop – For fun..
Thank you.
Contact information:
Cahit Gürgüc
Senior Developer
https://twitter.com/aborjinik
https://www.linkedin.com/in/cahitgurguc

More Related Content

What's hot

General steps of finite element analysis
General steps of finite element analysisGeneral steps of finite element analysis
General steps of finite element analysis
Sasi Kumar
 
Launch CReader V+ User Manual
Launch CReader V+ User ManualLaunch CReader V+ User Manual
Launch CReader V+ User Manual
Tim Miller
 
LIGGGHTS installation-guide
LIGGGHTS installation-guideLIGGGHTS installation-guide
LIGGGHTS installation-guide
Braj Bhushan Prasad
 
Finite Element Analysis of Effect of Punching Shear in Flat Slab Using Ansys ...
Finite Element Analysis of Effect of Punching Shear in Flat Slab Using Ansys ...Finite Element Analysis of Effect of Punching Shear in Flat Slab Using Ansys ...
Finite Element Analysis of Effect of Punching Shear in Flat Slab Using Ansys ...
inventionjournals
 
UVM Update: Register Package
UVM Update: Register PackageUVM Update: Register Package
UVM Update: Register Package
DVClub
 
Speech Recognition No Code
Speech Recognition No CodeSpeech Recognition No Code
Speech Recognition No Code
Gerome Jan M. Llames
 
Post operational activities
Post operational activitiesPost operational activities
Post operational activities
Sunish Sudhir Jagtap
 
PerfectVIPs Uvm tlm slides format
PerfectVIPs Uvm tlm slides formatPerfectVIPs Uvm tlm slides format
PerfectVIPs Uvm tlm slides format
Akash Mohanty
 
Case study on change control in equipment
Case study on change control in equipmentCase study on change control in equipment
Case study on change control in equipment
S S N D Balakrishna Ch
 
Book Preview: A Practical Introduction to the Xilinx Zynq-7000 Adaptive SoC
Book Preview: A Practical Introduction to the Xilinx Zynq-7000 Adaptive SoCBook Preview: A Practical Introduction to the Xilinx Zynq-7000 Adaptive SoC
Book Preview: A Practical Introduction to the Xilinx Zynq-7000 Adaptive SoC
Derek Murray
 
21 cfr part 11
21 cfr part 1121 cfr part 11
21 cfr part 11
roshankhetade2
 
21C CRF Part 11
21C CRF Part 1121C CRF Part 11
21C CRF Part 11
ClinosolIndia
 
V model concept of validation
V model concept of validation V model concept of validation
V model concept of validation
Guru Balaji .S
 

What's hot (13)

General steps of finite element analysis
General steps of finite element analysisGeneral steps of finite element analysis
General steps of finite element analysis
 
Launch CReader V+ User Manual
Launch CReader V+ User ManualLaunch CReader V+ User Manual
Launch CReader V+ User Manual
 
LIGGGHTS installation-guide
LIGGGHTS installation-guideLIGGGHTS installation-guide
LIGGGHTS installation-guide
 
Finite Element Analysis of Effect of Punching Shear in Flat Slab Using Ansys ...
Finite Element Analysis of Effect of Punching Shear in Flat Slab Using Ansys ...Finite Element Analysis of Effect of Punching Shear in Flat Slab Using Ansys ...
Finite Element Analysis of Effect of Punching Shear in Flat Slab Using Ansys ...
 
UVM Update: Register Package
UVM Update: Register PackageUVM Update: Register Package
UVM Update: Register Package
 
Speech Recognition No Code
Speech Recognition No CodeSpeech Recognition No Code
Speech Recognition No Code
 
Post operational activities
Post operational activitiesPost operational activities
Post operational activities
 
PerfectVIPs Uvm tlm slides format
PerfectVIPs Uvm tlm slides formatPerfectVIPs Uvm tlm slides format
PerfectVIPs Uvm tlm slides format
 
Case study on change control in equipment
Case study on change control in equipmentCase study on change control in equipment
Case study on change control in equipment
 
Book Preview: A Practical Introduction to the Xilinx Zynq-7000 Adaptive SoC
Book Preview: A Practical Introduction to the Xilinx Zynq-7000 Adaptive SoCBook Preview: A Practical Introduction to the Xilinx Zynq-7000 Adaptive SoC
Book Preview: A Practical Introduction to the Xilinx Zynq-7000 Adaptive SoC
 
21 cfr part 11
21 cfr part 1121 cfr part 11
21 cfr part 11
 
21C CRF Part 11
21C CRF Part 1121C CRF Part 11
21C CRF Part 11
 
V model concept of validation
V model concept of validation V model concept of validation
V model concept of validation
 

Similar to 2018 UI5con Drag-and-Drop Concept

Design Patterns for Tablets and Smartphones
Design Patterns for Tablets and SmartphonesDesign Patterns for Tablets and Smartphones
Design Patterns for Tablets and Smartphones
Michael Galpin
 
Android 3
Android 3Android 3
Android 3
Robert Cooper
 
混搭移动开发:PhoneGap+JQurey+Dreamweaver
混搭移动开发:PhoneGap+JQurey+Dreamweaver混搭移动开发:PhoneGap+JQurey+Dreamweaver
混搭移动开发:PhoneGap+JQurey+Dreamweaver
yangdj
 
After max+phonegap
After max+phonegapAfter max+phonegap
After max+phonegap
yangdj
 
Introduction to Palm's Mojo SDK
Introduction to Palm's Mojo SDKIntroduction to Palm's Mojo SDK
Introduction to Palm's Mojo SDK
Brendan Lim
 
Getting Started With Material Design
Getting Started With Material DesignGetting Started With Material Design
Getting Started With Material Design
Yasin Yildirim
 
Android activity, service, and broadcast recievers
Android activity, service, and broadcast recieversAndroid activity, service, and broadcast recievers
Android activity, service, and broadcast recievers
Utkarsh Mankad
 
Javascript is your (Auto)mate
Javascript is your (Auto)mateJavascript is your (Auto)mate
Javascript is your (Auto)mate
Codemotion
 
Android JetPack: easy navigation with the new Navigation Controller
Android JetPack: easy navigation with the new Navigation ControllerAndroid JetPack: easy navigation with the new Navigation Controller
Android JetPack: easy navigation with the new Navigation Controller
Leonardo Pirro
 
08ui.pptx
08ui.pptx08ui.pptx
08ui.pptx
KabadaSori
 
Android app development basics
Android app development basicsAndroid app development basics
Android app development basics
Anton Narusberg
 
What's New in Android
What's New in AndroidWhat's New in Android
What's New in Android
Robert Cooper
 
Mooscon 2013 cebit - google integration in android apps (1)
Mooscon 2013   cebit - google integration in android apps (1)Mooscon 2013   cebit - google integration in android apps (1)
Mooscon 2013 cebit - google integration in android apps (1)
Heinrich Seeger
 
Beginning Native Android Apps
Beginning Native Android AppsBeginning Native Android Apps
Beginning Native Android Apps
Gil Irizarry
 
Client-side Rendering with AngularJS
Client-side Rendering with AngularJSClient-side Rendering with AngularJS
Client-side Rendering with AngularJS
David Lapsley
 
Air Drag And Drop
Air Drag And DropAir Drag And Drop
Air Drag And Drop
michael.labriola
 
Zyncro zyncro apps & ui customization feb 2013
Zyncro zyncro apps & ui customization feb 2013Zyncro zyncro apps & ui customization feb 2013
Zyncro zyncro apps & ui customization feb 2013
Zyncro
 
07_UIAndroid.pdf
07_UIAndroid.pdf07_UIAndroid.pdf
07_UIAndroid.pdf
ImranS18
 
Android Nâng cao-Bài 9-Debug in Android Application Development
Android Nâng cao-Bài 9-Debug in Android Application Development Android Nâng cao-Bài 9-Debug in Android Application Development
Android Nâng cao-Bài 9-Debug in Android Application Development
Phuoc Nguyen
 
Dn d clipboard
Dn d clipboardDn d clipboard
Dn d clipboard
pinnamur
 

Similar to 2018 UI5con Drag-and-Drop Concept (20)

Design Patterns for Tablets and Smartphones
Design Patterns for Tablets and SmartphonesDesign Patterns for Tablets and Smartphones
Design Patterns for Tablets and Smartphones
 
Android 3
Android 3Android 3
Android 3
 
混搭移动开发:PhoneGap+JQurey+Dreamweaver
混搭移动开发:PhoneGap+JQurey+Dreamweaver混搭移动开发:PhoneGap+JQurey+Dreamweaver
混搭移动开发:PhoneGap+JQurey+Dreamweaver
 
After max+phonegap
After max+phonegapAfter max+phonegap
After max+phonegap
 
Introduction to Palm's Mojo SDK
Introduction to Palm's Mojo SDKIntroduction to Palm's Mojo SDK
Introduction to Palm's Mojo SDK
 
Getting Started With Material Design
Getting Started With Material DesignGetting Started With Material Design
Getting Started With Material Design
 
Android activity, service, and broadcast recievers
Android activity, service, and broadcast recieversAndroid activity, service, and broadcast recievers
Android activity, service, and broadcast recievers
 
Javascript is your (Auto)mate
Javascript is your (Auto)mateJavascript is your (Auto)mate
Javascript is your (Auto)mate
 
Android JetPack: easy navigation with the new Navigation Controller
Android JetPack: easy navigation with the new Navigation ControllerAndroid JetPack: easy navigation with the new Navigation Controller
Android JetPack: easy navigation with the new Navigation Controller
 
08ui.pptx
08ui.pptx08ui.pptx
08ui.pptx
 
Android app development basics
Android app development basicsAndroid app development basics
Android app development basics
 
What's New in Android
What's New in AndroidWhat's New in Android
What's New in Android
 
Mooscon 2013 cebit - google integration in android apps (1)
Mooscon 2013   cebit - google integration in android apps (1)Mooscon 2013   cebit - google integration in android apps (1)
Mooscon 2013 cebit - google integration in android apps (1)
 
Beginning Native Android Apps
Beginning Native Android AppsBeginning Native Android Apps
Beginning Native Android Apps
 
Client-side Rendering with AngularJS
Client-side Rendering with AngularJSClient-side Rendering with AngularJS
Client-side Rendering with AngularJS
 
Air Drag And Drop
Air Drag And DropAir Drag And Drop
Air Drag And Drop
 
Zyncro zyncro apps & ui customization feb 2013
Zyncro zyncro apps & ui customization feb 2013Zyncro zyncro apps & ui customization feb 2013
Zyncro zyncro apps & ui customization feb 2013
 
07_UIAndroid.pdf
07_UIAndroid.pdf07_UIAndroid.pdf
07_UIAndroid.pdf
 
Android Nâng cao-Bài 9-Debug in Android Application Development
Android Nâng cao-Bài 9-Debug in Android Application Development Android Nâng cao-Bài 9-Debug in Android Application Development
Android Nâng cao-Bài 9-Debug in Android Application Development
 
Dn d clipboard
Dn d clipboardDn d clipboard
Dn d clipboard
 

Recently uploaded

Upturn India Technologies - Web development company in Nashik
Upturn India Technologies - Web development company in NashikUpturn India Technologies - Web development company in Nashik
Upturn India Technologies - Web development company in Nashik
Upturn India Technologies
 
8 Best Automated Android App Testing Tool and Framework in 2024.pdf
8 Best Automated Android App Testing Tool and Framework in 2024.pdf8 Best Automated Android App Testing Tool and Framework in 2024.pdf
8 Best Automated Android App Testing Tool and Framework in 2024.pdf
kalichargn70th171
 
一比一原版(sdsu毕业证书)圣地亚哥州立大学毕业证如何办理
一比一原版(sdsu毕业证书)圣地亚哥州立大学毕业证如何办理一比一原版(sdsu毕业证书)圣地亚哥州立大学毕业证如何办理
一比一原版(sdsu毕业证书)圣地亚哥州立大学毕业证如何办理
kgyxske
 
The Rising Future of CPaaS in the Middle East 2024
The Rising Future of CPaaS in the Middle East 2024The Rising Future of CPaaS in the Middle East 2024
The Rising Future of CPaaS in the Middle East 2024
Yara Milbes
 
Measures in SQL (SIGMOD 2024, Santiago, Chile)
Measures in SQL (SIGMOD 2024, Santiago, Chile)Measures in SQL (SIGMOD 2024, Santiago, Chile)
Measures in SQL (SIGMOD 2024, Santiago, Chile)
Julian Hyde
 
Kubernetes at Scale: Going Multi-Cluster with Istio
Kubernetes at Scale:  Going Multi-Cluster  with IstioKubernetes at Scale:  Going Multi-Cluster  with Istio
Kubernetes at Scale: Going Multi-Cluster with Istio
Severalnines
 
TMU毕业证书精仿办理
TMU毕业证书精仿办理TMU毕业证书精仿办理
TMU毕业证书精仿办理
aeeva
 
Liberarsi dai framework con i Web Component.pptx
Liberarsi dai framework con i Web Component.pptxLiberarsi dai framework con i Web Component.pptx
Liberarsi dai framework con i Web Component.pptx
Massimo Artizzu
 
Alluxio Webinar | 10x Faster Trino Queries on Your Data Platform
Alluxio Webinar | 10x Faster Trino Queries on Your Data PlatformAlluxio Webinar | 10x Faster Trino Queries on Your Data Platform
Alluxio Webinar | 10x Faster Trino Queries on Your Data Platform
Alluxio, Inc.
 
Photoshop Tutorial for Beginners (2024 Edition)
Photoshop Tutorial for Beginners (2024 Edition)Photoshop Tutorial for Beginners (2024 Edition)
Photoshop Tutorial for Beginners (2024 Edition)
alowpalsadig
 
A Comprehensive Guide on Implementing Real-World Mobile Testing Strategies fo...
A Comprehensive Guide on Implementing Real-World Mobile Testing Strategies fo...A Comprehensive Guide on Implementing Real-World Mobile Testing Strategies fo...
A Comprehensive Guide on Implementing Real-World Mobile Testing Strategies fo...
kalichargn70th171
 
ppt on the brain chip neuralink.pptx
ppt  on   the brain  chip neuralink.pptxppt  on   the brain  chip neuralink.pptx
ppt on the brain chip neuralink.pptx
Reetu63
 
一比一原版(USF毕业证)旧金山大学毕业证如何办理
一比一原版(USF毕业证)旧金山大学毕业证如何办理一比一原版(USF毕业证)旧金山大学毕业证如何办理
一比一原版(USF毕业证)旧金山大学毕业证如何办理
dakas1
 
Orca: Nocode Graphical Editor for Container Orchestration
Orca: Nocode Graphical Editor for Container OrchestrationOrca: Nocode Graphical Editor for Container Orchestration
Orca: Nocode Graphical Editor for Container Orchestration
Pedro J. Molina
 
Why Apache Kafka Clusters Are Like Galaxies (And Other Cosmic Kafka Quandarie...
Why Apache Kafka Clusters Are Like Galaxies (And Other Cosmic Kafka Quandarie...Why Apache Kafka Clusters Are Like Galaxies (And Other Cosmic Kafka Quandarie...
Why Apache Kafka Clusters Are Like Galaxies (And Other Cosmic Kafka Quandarie...
Paul Brebner
 
DevOps Consulting Company | Hire DevOps Services
DevOps Consulting Company | Hire DevOps ServicesDevOps Consulting Company | Hire DevOps Services
DevOps Consulting Company | Hire DevOps Services
seospiralmantra
 
Boost Your Savings with These Money Management Apps
Boost Your Savings with These Money Management AppsBoost Your Savings with These Money Management Apps
Boost Your Savings with These Money Management Apps
Jhone kinadey
 
Manyata Tech Park Bangalore_ Infrastructure, Facilities and More
Manyata Tech Park Bangalore_ Infrastructure, Facilities and MoreManyata Tech Park Bangalore_ Infrastructure, Facilities and More
Manyata Tech Park Bangalore_ Infrastructure, Facilities and More
narinav14
 
The Power of Visual Regression Testing_ Why It Is Critical for Enterprise App...
The Power of Visual Regression Testing_ Why It Is Critical for Enterprise App...The Power of Visual Regression Testing_ Why It Is Critical for Enterprise App...
The Power of Visual Regression Testing_ Why It Is Critical for Enterprise App...
kalichargn70th171
 
42 Ways to Generate Real Estate Leads - Sellxpert
42 Ways to Generate Real Estate Leads - Sellxpert42 Ways to Generate Real Estate Leads - Sellxpert
42 Ways to Generate Real Estate Leads - Sellxpert
vaishalijagtap12
 

Recently uploaded (20)

Upturn India Technologies - Web development company in Nashik
Upturn India Technologies - Web development company in NashikUpturn India Technologies - Web development company in Nashik
Upturn India Technologies - Web development company in Nashik
 
8 Best Automated Android App Testing Tool and Framework in 2024.pdf
8 Best Automated Android App Testing Tool and Framework in 2024.pdf8 Best Automated Android App Testing Tool and Framework in 2024.pdf
8 Best Automated Android App Testing Tool and Framework in 2024.pdf
 
一比一原版(sdsu毕业证书)圣地亚哥州立大学毕业证如何办理
一比一原版(sdsu毕业证书)圣地亚哥州立大学毕业证如何办理一比一原版(sdsu毕业证书)圣地亚哥州立大学毕业证如何办理
一比一原版(sdsu毕业证书)圣地亚哥州立大学毕业证如何办理
 
The Rising Future of CPaaS in the Middle East 2024
The Rising Future of CPaaS in the Middle East 2024The Rising Future of CPaaS in the Middle East 2024
The Rising Future of CPaaS in the Middle East 2024
 
Measures in SQL (SIGMOD 2024, Santiago, Chile)
Measures in SQL (SIGMOD 2024, Santiago, Chile)Measures in SQL (SIGMOD 2024, Santiago, Chile)
Measures in SQL (SIGMOD 2024, Santiago, Chile)
 
Kubernetes at Scale: Going Multi-Cluster with Istio
Kubernetes at Scale:  Going Multi-Cluster  with IstioKubernetes at Scale:  Going Multi-Cluster  with Istio
Kubernetes at Scale: Going Multi-Cluster with Istio
 
TMU毕业证书精仿办理
TMU毕业证书精仿办理TMU毕业证书精仿办理
TMU毕业证书精仿办理
 
Liberarsi dai framework con i Web Component.pptx
Liberarsi dai framework con i Web Component.pptxLiberarsi dai framework con i Web Component.pptx
Liberarsi dai framework con i Web Component.pptx
 
Alluxio Webinar | 10x Faster Trino Queries on Your Data Platform
Alluxio Webinar | 10x Faster Trino Queries on Your Data PlatformAlluxio Webinar | 10x Faster Trino Queries on Your Data Platform
Alluxio Webinar | 10x Faster Trino Queries on Your Data Platform
 
Photoshop Tutorial for Beginners (2024 Edition)
Photoshop Tutorial for Beginners (2024 Edition)Photoshop Tutorial for Beginners (2024 Edition)
Photoshop Tutorial for Beginners (2024 Edition)
 
A Comprehensive Guide on Implementing Real-World Mobile Testing Strategies fo...
A Comprehensive Guide on Implementing Real-World Mobile Testing Strategies fo...A Comprehensive Guide on Implementing Real-World Mobile Testing Strategies fo...
A Comprehensive Guide on Implementing Real-World Mobile Testing Strategies fo...
 
ppt on the brain chip neuralink.pptx
ppt  on   the brain  chip neuralink.pptxppt  on   the brain  chip neuralink.pptx
ppt on the brain chip neuralink.pptx
 
一比一原版(USF毕业证)旧金山大学毕业证如何办理
一比一原版(USF毕业证)旧金山大学毕业证如何办理一比一原版(USF毕业证)旧金山大学毕业证如何办理
一比一原版(USF毕业证)旧金山大学毕业证如何办理
 
Orca: Nocode Graphical Editor for Container Orchestration
Orca: Nocode Graphical Editor for Container OrchestrationOrca: Nocode Graphical Editor for Container Orchestration
Orca: Nocode Graphical Editor for Container Orchestration
 
Why Apache Kafka Clusters Are Like Galaxies (And Other Cosmic Kafka Quandarie...
Why Apache Kafka Clusters Are Like Galaxies (And Other Cosmic Kafka Quandarie...Why Apache Kafka Clusters Are Like Galaxies (And Other Cosmic Kafka Quandarie...
Why Apache Kafka Clusters Are Like Galaxies (And Other Cosmic Kafka Quandarie...
 
DevOps Consulting Company | Hire DevOps Services
DevOps Consulting Company | Hire DevOps ServicesDevOps Consulting Company | Hire DevOps Services
DevOps Consulting Company | Hire DevOps Services
 
Boost Your Savings with These Money Management Apps
Boost Your Savings with These Money Management AppsBoost Your Savings with These Money Management Apps
Boost Your Savings with These Money Management Apps
 
Manyata Tech Park Bangalore_ Infrastructure, Facilities and More
Manyata Tech Park Bangalore_ Infrastructure, Facilities and MoreManyata Tech Park Bangalore_ Infrastructure, Facilities and More
Manyata Tech Park Bangalore_ Infrastructure, Facilities and More
 
The Power of Visual Regression Testing_ Why It Is Critical for Enterprise App...
The Power of Visual Regression Testing_ Why It Is Critical for Enterprise App...The Power of Visual Regression Testing_ Why It Is Critical for Enterprise App...
The Power of Visual Regression Testing_ Why It Is Critical for Enterprise App...
 
42 Ways to Generate Real Estate Leads - Sellxpert
42 Ways to Generate Real Estate Leads - Sellxpert42 Ways to Generate Real Estate Leads - Sellxpert
42 Ways to Generate Real Estate Leads - Sellxpert
 

2018 UI5con Drag-and-Drop Concept

  • 1. Cahit Gürgüc, SAP SE June 22, 2018 Drag & Drop Concept in UI5
  • 2. 2 Drag & Drop – Fiori Launchpad
  • 3. 3 Drag & Drop – Overview Page
  • 4. 4 Drag & Drop – Browse & Collect Pattern
  • 6. 6 UIArea preprocessEvent postprocessEvent Element dragDropConfig aggregation DragAndDrop (enhance browser events)plugs in event handling Standard Browser Events: • dragstart • dragenter • dragover • dragleave • dragend • drop PLUS: • Consistent across browsers • DragSession (data transfer) • Enhanced ghost (+badge) • Visual style for source/target DragDropInfo [sourceAggregation] [targetAggregation] [targetElement] drop event dragEnter event DragSession Simple config for standard use-cases: • Specifies source + target • Declarative, bindable • Allows providing ACC alternatives • Event driven 0..n BrowserEventLevelControlLevel RenderManager ("draggable" attribute) writeElementData
  • 7. 7 • DragDropInfo can be used when the drag source and the drop target are tightly coupled and both are known. • DragInfo can be used just to allow dragging when drop target is not known or not owned. • DropInfo can be used as a general drop target. Config Types - Overview
  • 8. 8 Config Types - Details DragDropInfo [targetElement=parent] (0..1) [sourceAggregation] [targetAggregation] [dropEffect="Move"] [dropPosition="On"] dragStart dragEnter dragOver drop dragEnd DragInfo [sourceAggregation] [groupName] dragStart dragEnd DropInfo [targetAggregation] [groupName] [dropEffect="Move"] [dropPosition="On"] dragEnter dragOver drop(tightly coupled cases) (loosely coupled cases) connected
  • 9. 9 Drag & Drop Use-Cases Within controls: • Re-ordering a List • Moving items within Tree • Re-ordering IconTabBar Tabs Between controls: • Moving items between two lists (browse-and-collect) • Moving items of any kind to Co-Pilot to do something with the associated data Outside the browser: • Drag any piece of text or html or so into the browser • Drag a file into the browser • Drag some data out of a Table into an Excel file • Drag some data to a local file DragInfo DragDropInfo DropInfo DragDropInfo DragDropInfo DragDropInfo DropInfo DragInfo DragInfo
  • 10. 10 <List headerText="Drag my items"> <dragDropConfig> <dnd:DragDropInfo sourceAggregation="items" targetElement="otherList" drop="handleDrop" /> </dragDropConfig> <items> <StandardListItem ... /> </items> </List> <List headerText="Drop here" id="otherList"> ... </List> Example 1: Drag from one List to another List Plus "do the needful" in Controller.handleDrop()
  • 11. 11 Example 2: Reordering List Items <List headerText="Reorder my items"> <dragDropConfig> <dnd:DragDropInfo sourceAggregation="items" targetAggregation="items" drop="handleReorder" /> </dragDropConfig> <items> <StandardListItem ... /> </items> </List> Plus "do the needful" in Controller.handleReorder()
  • 12. 12 Drag from known source to known target:  Just specify source and "targetElement" in the DragDropInfo and handle the "drop" event Loosely coupled drag&drop (e.g. multiple/dynamic sources or targets):  Specify DragInfos and DropInfos with same "groupName" and handle "drop" event Drag with unknown/external target (other view, FLP, outside browser):  Specify DragInfo, add suitable data, optionally add predefined "groupName" for the target Receive from unknown/external source (other view, FLP, file system):  Specify DropInfo, optionally an expected "groupName", handle "drop" event, but validate transferred data! Anything unexpected may come in! Programming Model – Use Cases
  • 13. 13 Copy vs Move vs Link:  Set "dropEffect" on DropInfo/DragDropInfo "Drop On" vs "Insert Between":  Set "dropPosition" property of DropInfo/DragDropInfo Transferring data: (caveat: not all options are available in all browsers)  Either access source control in "drop" event, if well-known  Or use "setData", "setTextData", "setComplexData" via DragSession on "dragstart" event Programming Model – Further Options
  • 14. 14 Not all items should be dragged:  Handle "dragstart" event on DragInfo and prevent default of the event. Not all items are valid drop targets:  Handle "dragenter" event on DropInfo and prevent the default of the event. One can drop into some targets, but between other targets:  Handle "dragenter" event on DropInfo and set "dropPosition" accordingly Programming Model – Special Handling
  • 15. 15 If the offered configuration is not flexible enough:  Just use the standard drag&drop events  They are still enhanced by UI5 to provide proper ghost images etc. To make drag&drop work across all devices/platforms  Do not use any native browser features – because they do not work in some browsers or are not available at all (e.g. no native drag&drop on touch devices)  Only use Drag/DropInfo configuration and the DragSession object APIs To make drag&drop accessible for non-mouse-users  Only use Drag/DropInfo configuration and the DragSession object APIs Programming Model – Fundemantals
  • 17. 17 Control.extend('my.CustomControl', { metadata : { properties : { value : { type : 'string' }, width : { type : 'sap.ui.core.CSSSize', defaultValue : 'auto' } }, dnd : { draggable: false, droppable: true }, aggregations : { header : { type : "sap.ui.core.Control", multiple : false, dnd : false }, items : { type: 'sap.ui.core.Control', multiple : true, selector : "#{id}-items", dnd : { draggable: true, dropppable: true, layout: "Horizontal" } }, } } Metadata
  • 18. 18
  • 19. 19 • There is no mobile device that supports drag and drop. Polyfill is planned. • Transparency of the drag ghost element and the cursor during drag-and-drop operations are not configurable. • Setting constraints on drag position is not possible. • Texts in draggable controls cannot be selected. • IE11 only supports plain text MIME type for the DataTransfer Object. Also defining a custom drag ghost is not possible. Limitations
  • 20. 20 Drag & Drop – For fun..
  • 21. Thank you. Contact information: Cahit Gürgüc Senior Developer https://twitter.com/aborjinik https://www.linkedin.com/in/cahitgurguc