Presentation on theme: "Integration between HTML 5 Drag & Drop and SAP ABAP HTTP ICF Services Alessandro Spadoni & Patrizia Rossi October 8th, 2011 1."— Presentation transcript:
Integration between HTML 5 Drag & Drop and SAP ABAP HTTP ICF Services Alessandro Spadoni & Patrizia Rossi October 8th, 2011 1
There are number of events which are fired during various stages of the DnD operation: Dragstart 3 Drag & Drop events
There are number of events which are fired during various stages of the DnD operation: Dragstart Drag Dragenter Dragover Dragleave Drop Dragend 11 Drag & Drop events
EventsDescription dragstart Fires when the user starts dragging of the object. The most important property of a dragstart event object is dataTransfer. The setData() method can be called in response to the dragstart event. drag Fires every time the mouse is moved while the object is being dragged. dragenter Fired when the mouse is first moved over the target element while a drag is occurring. A listener for this event should indicate whether a drop is allowed over this location. If there are no listeners, or the listeners perform no operations, then a drop is not allowed by default. dragover This event is fired as the mouse is moved over an element when a drag is occurring. Much of the time, the operation that occurs during a listener will be the same as the dragenter event. dragleave This event is fired when the mouse leaves an element while a drag is occurring. Listeners should remove any highlighting or insertion markers used for drop feedback. drop The drop event is fired on the element where the drop was occurred at the end of the drag operation. A listener would be responsible for retrieving the data being dragged and inserting it at the drop location. The most important property of a drop event object is dataTransfer. The getData() method can be called in response to the drop event. dragend Fires when the user releases the mouse button while dragging an object. 12 Drag & Drop events - Summary
Next slide shows a first example of integration between Html 5 and Sap. Given a draggable element of type, we can export his contents (DOM innerHTML) in excel format by calling a Sap SICF Service synchronously submitting an HTML form via POST method. SAP Service parses HTML code as XML using class CL_IXML and our custom class ZCL_HTML_TABLEPARSER. HTTP Response will return a binary Excel as Attachment. 13 Integration DnD with Sap – Part I
16 Integration DnD with Sap – Part II Next slide shows a second example of integration. Dragging an AIRLINE image in a target area: On Drop event we can do an AJAX request to Abap SICF Service. Response is a JSON Object containing SFlights Data.