5 x HTML5 worth using in APEX (5)

Christian Rokitta
Christian RokittaOracle Database & APEX Developer, APEX UI Designer, Oracle ACE
5 x HTML5
in
APEX (5)
Christian Rokitta
HTML5 + APEX5 = Perfect 10
(Shakeeb)
Program
• HTML 5 – What‘s new?
• HTML5 Tags
o <dialog> element: Modals made easy
o <output>
• HTML5 API’s
o Drag and Drop
o Geolocation API
o SSE
Why HTML5?
• Multiple Devices (Mobile, Mobile, Mobile)
• Modular
• Multimedia
• Semantics (cleaner code, accessibility)
• Interactivity (tighter integration with
JavaScript)
• Structure vs Presentation, CSS3
What is New in HTML5?
• Simplified DOCTYPE: <!DOCTYPE html>
• New HTML Elements
• HTML APIs
• Elements Removed in HTML5  CSS
<center>, <frame>/<frameset>, <big>, <font>, …
Standard? Sorry, not yet.
Version Year
Tim Berners-Lee invented www 1989
Tim Berners-Lee invented HTML 1991
Dave Raggett drafted HTML+ 1993
HTML Working Group defined HTML 2.0 1995
W3C Recommended HTML 3.2 1997
W3C Recommended HTML 4.01 1999
W3C Recommended XHTML 1.0 2000
HTML5 WHATWG* First Public Draft 2008
HTML5 WHATWG Living Standard 2012
HTML5 W3C Final Recommendation 2014
*) Web Hypertext Application Technology Working Group - was formed in response to slow W3C development, and W3C's decision to close
down the development of HTML, in favor of XHTML
HTML5 New Elements
• Semantic/Structural Elements
<article>, <aside>, <dialog> <footer>, <header>, <menuitem>, <nav>, <section>, …
• Form Elements
<datalist>, <output>, …
• Input Types
tel, timcolor, date, email, number,search, e, url, …
• Input Attributes
autocomplete, autofocus, min/max, placeholder, …
• New Attribute Syntax
<input type="text" value=John>, <input type="text" value='John Doe'>, …
• HTML5 Graphics
<canvas>, <svg>
• New Media Elements
<audio>, <video>, <track>, …
<dialog> element: Modals made
easy
<table>
<tr>
<th>January <dialog open>This is an open dialog window</dialog></th>
<th>February</th>
<th>March</th>
</tr>
<tr>
<td>31</td>
<td>28</td>
<td>31</td>
</tr>
</table>
<table>
<tr>
<th>January <dialog>This is an open dialog window</dialog></th>
<th>February</th>
<th>March</th>
</tr>
<tr>
<td>31</td>
<td>28</td>
<td>31</td>
</tr>
</table>
<dialog> element: specs
• show(): Open dialog.
• close(): Close dialog. Takes an optional argument
which if present dialog.returnValue is set to.
• showModal(): Open modal dialog.
• ::backdrop: Pseudo-element to style background
behind a modal dialog.
• close event: Fired when a dialog is closed.
• cancel event: Fired when the Escape key is pressed
on a modal dialog.
<dialog> demo
<dialog>, some final questions
• Why do we need <dialog> element while it's
possible using libraries?
o great for accessibility
o modal dialogs are pushed on a well-ordered stack (no z-
index)
• How do I position a dialog?
CSS! default CSS includes "position: absolute; left: 0; right: 0;
margin: auto;" which horizontally centers the element within
its container.
• Can I open multiple dialogs?
Yes. Much like multiple <div> elements stacked on eachother.
<output> element: input Antipode
<form>
<label for="ticketcount">Number of passes</label>
<input type="number" name="ticketcount" id="ticketcount"
min="1" max="12" value="1" onchange="spinny()">
<span id="price">@ $25 per ticket</span> =
<output name="total" for="ticketcount price">$25</output>
</form>
var total = document.querySelector('output[name="total"]');
var ticketcount = document.getElementById('ticketcount');
function spinny() { total.value = "$" + parseInt(ticketcount.value) * 25; }
<output> element: specs
<form oninput="x.value=parseInt(a.value)+parseInt(b.value)">0
<input type="range" id="a" value="50">100
+<input type="number" id="b" value="50">
=<output name="x" for="a b"></output>
</form>
HTML5 valueAsNumber input element property:
<form oninput="x.value=a.valueAsNumber+b.valueAsNumber">0
<input type="range" id="a" value="50">100
+<input type="number" id="b" value="50">
=<output name="x" for="a b"></output>
</form>
<output> element: Attributes
Attribute Value Description
for element_id Specifies the relationship between the result of the
calculation, and the elements used in the calculation
form form_id Specifies one or more forms the output element belongs to
name name Specifies a name for the output element
<output> demo
Drag and Drop API
Drag and drop is a very common feature. It is
when you "grab" an object and drag it to a
different location.
In HTML5, drag and drop is part of the standard,
and any element can be draggable.
Drag and Drop Example
<!DOCTYPE HTML>
<html>
<head>
<script>
function allowDrop(ev) {
ev.preventDefault();
}
function drag(ev) {
ev.dataTransfer.setData("text", ev.target.id);
}
function drop(ev) {
ev.preventDefault();
var data = ev.dataTransfer.getData("text");
ev.target.appendChild(document.getElementById(data));
}
</script>
</head>
<body>
<div id="div1" ondrop="drop(event)" ondragover="allowDrop(event)"></div>
<img id="drag1" src="img_logo.gif" draggable="true"
ondragstart="drag(event)" width="336" height="69">
</body>
</html>
Parts of a Drag and Drop event
• Make an Element Draggable
<img draggable="true">
• What to Drag - ondragstart and setData()
function drag(ev) {
ev.dataTransfer.setData("text", ev.target.id);
}
• Where to Drop – ondragover
event.preventDefault()
• Do the Drop - ondrop
function drop(ev) {
ev.preventDefault();
var data = ev.dataTransfer.getData("text");
ev.target.appendChild(document.getElementById(data));
}
Drag and Drop demo
Geolocation API
The HTML Geolocation API is used to get the
geographical position of a user/device*.
Since this can compromise user privacy, the
position is not available unless the user
approves it.
*) accurate for devices with GPS
Using HTML Geolocation
<script>
var x = document.getElementById("demo");
function getLocation() {
if (navigator.geolocation) {
navigator.geolocation.getCurrentPosition(showPosition);
} else {
x.innerHTML = "Geolocation is not supported by this browser.";
}
}
function showPosition(position) {
x.innerHTML = "Latitude: " + position.coords.latitude +
"<br>Longitude: " + position.coords.longitude;
}
</script>
Geolocation Example explained
• Check if Geolocation is supported
• If supported, run the getCurrentPosition()
method. If not, display a message to the user
• If the getCurrentPosition() method is successful,
it returns a coordinates object to the function
specified in the parameter ( showPosition )
• The showPosition() function gets the displays the
Latitude and Longitude
Handling Errors and Rejections
navigator.geolocation.getCurrentPosition(showPosition,showError);
function showError(error) {
switch(error.code) {
case error.PERMISSION_DENIED:
x.innerHTML = "User denied the request for Geolocation."
break;
case error.POSITION_UNAVAILABLE:
x.innerHTML = "Location information is unavailable."
break;
case error.TIMEOUT:
x.innerHTML = "The request to get user location timed out."
break;
case error.UNKNOWN_ERROR:
x.innerHTML = "An unknown error occurred."
break;
}
}
getCurrentPosition() - Return Data
Property Description
coords.latitude The latitude as a decimal number
coords.longitude The longitude as a decimal number
coords.accuracy The accuracy of position
coords.altitude The altitude in meters above the mean sea level
coords.altitudeAccuracy The altitude accuracy of position
coords.heading The heading as degrees clockwise from North
coords.speed The speed in meters per second
timestamp The date/time of the response
The getCurrentPosition() method returns an object if it is successful. The latitude, longitude and
accuracy properties are always returned. The other properties below are returned if available.
Geolocation - Other Methods
id = navigator.geolocation.watchPosition( success
, error
, options);
options = { enableHighAccuracy: false
, timeout: 5000
, maximumAge: 0 };
navigator.geolocation.clearWatch(id);
Geolocation Demo
Server-Sent Events - One Way Messaging
• A server-sent event is when a web page
automatically gets updates from a server.
• A web app "subscribes" to a stream of
updates generated by a server and, whenever
a new event occurs, a notification is triggered
on the client.
Server-Sent Events vs. WebSockets
Websockets:
• APIs like WebSockets provide a richer protocol
to perform bi-directional, full-duplex
communication.
• Two-way channel is more attractive for things
like games, messaging apps, and for cases
where you need near real-time updates in
both directions.
Server-Sent Events vs. WebSockets
Server-Send Events:
• Two-way channel is more attractive for things like
games, messaging apps, and for cases where you
need near real-time updates in both directions.
• SSE in favor when you simply need updates from
some server action. If you'll need to send data to
a server, XMLHttpRequest is always a friend.
Server-Sent Events vs. WebSockets
SSEs are sent over traditional HTTP. That means
they do not require a special protocol or server
implementation to get working.
WebSockets on the other hand, require full-
duplex connections and new Web Socket servers
to handle the protocol.
In addition, Server-Sent Events have a variety of
features that WebSockets lack by design such
as automatic reconnection, event IDs.
SSE API - subscribe to an event stream
if (!!window.EventSource) {
var source = new EventSource('stream.php');
} else {
// Result to xhr polling :(
}
URL passed to the EventSource constructor is an absolute URL, its origin
(scheme, domain, port) must match that of the calling page
SSE API - handler for the message event
source.addEventListener('message', function(e) {
console.log(e.data);
}, false);
Optioneel:
source.addEventListener('open', function(e) {
// Connection was opened.
}, false);
source.addEventListener('error', function(e) {
if (e.readyState == EventSource.CLOSED) {
// Connection was closed.
}
}, false);
SSE API
• When updates are pushed from the server,
the onmessage handler fires and new data is be
available in its e.data property.
• The magical part is that whenever the connection
is closed, the browser will automatically
reconnect to the source after ~3 seconds.
• Your server implementation can even have
control over this reconnection timeout.
• That's it.
SSE - Event Stream Format
Plaintext response, served with a
text/event-stream Content-Type, that follows the SSE format.
In its basic form, the response should contain a "data:" line,
followed by your message, followed by two "n" characters to
end the stream:
data: My messagenn
Multiline Data:
data: first linen
data: second linenn
SSE - Send JSON Data
data: {n
data: "msg": "hello world",n
data: "id": 12345n
data: }nn
source.addEventListener('message', function(e) {
var data = JSON.parse(e.data);
console.log(data.id, data.msg);
}, false
);
SSE - Controlling the Reconnection-
timeout
The browser attempts to reconnect to the source roughly
3 seconds after each connection is closed. You can change
that timeout by including a line beginning with "retry:",
followed by the number of milliseconds to wait before
trying to reconnect.
The following example attempts a reconnect after 10
seconds:
retry: 10000n
data: hello worldnn
SSE Server – APEX Before Header Proces
DECLARE
dummy VARCHAR2(10);
BEGIN
sys.HTP.flush;
sys.HTP.init;
sys.OWA_UTIL.mime_header('text/event-stream', FALSE);
sys.OWA_UTIL.http_header_close;
sys.HTP.p('retry: 10000');
sys.HTP.p('data: {');
sys.HTP.p('data: "msg": "hello world",');
sys.HTP.p('data: "id": 12345');
sys.HTP.p('data: }');
sys.HTP.p(dummy);
APEX_APPLICATION.stop_apex_engine;
END;
SSE - Demo
bit.ly/1QGhkBz
apex.oracle.com/pls/apex/f?p=ac15geo
10. Juni, 11:00 – 11:45, Landskrone
Q & A
http://rokitta.blogspot.com
@crokitta
christian@rokitta.nl
http://www.themes4apex.com
http://plus.google.com/+ChristianRokitta
http://nl.linkedin.com/in/rokit/
1 of 39

Recommended

Browser Developer Tools by
Browser Developer ToolsBrowser Developer Tools
Browser Developer ToolsChristian Rokitta
2.1K views19 slides
Oracle APEX & PhoneGap by
Oracle APEX & PhoneGapOracle APEX & PhoneGap
Oracle APEX & PhoneGapChristian Rokitta
5.8K views31 slides
Creating a Business Oriented UI in APEX by
Creating a Business Oriented UI in APEXCreating a Business Oriented UI in APEX
Creating a Business Oriented UI in APEXEnkitec
4.2K views92 slides
Apex & jQuery Mobile by
Apex & jQuery MobileApex & jQuery Mobile
Apex & jQuery MobileChristian Rokitta
4.2K views34 slides
APEX Themes and Templates by
APEX Themes and TemplatesAPEX Themes and Templates
APEX Themes and TemplatesInSync Conference
17K views106 slides
"Native" Apps with APEX and PhoneGap by
"Native" Apps with APEX and PhoneGap"Native" Apps with APEX and PhoneGap
"Native" Apps with APEX and PhoneGapChristian Rokitta
6.7K views29 slides

More Related Content

What's hot

Get the Look and Feel You Want in Oracle APEX by
Get the Look and Feel You Want in Oracle APEXGet the Look and Feel You Want in Oracle APEX
Get the Look and Feel You Want in Oracle APEXJorge Rimblas
7.3K views64 slides
How to make APEX print through Node.js by
How to make APEX print through Node.jsHow to make APEX print through Node.js
How to make APEX print through Node.jsDimitri Gielis
28.9K views27 slides
COB - PowerApps - the good, the bad and the ugly - early 2018 by
COB - PowerApps - the good, the bad and the ugly - early 2018COB - PowerApps - the good, the bad and the ugly - early 2018
COB - PowerApps - the good, the bad and the ugly - early 2018Chris O'Brien
16.4K views29 slides
Oracle APEX migration to 5.1 - Our experience by
Oracle APEX migration to 5.1 - Our experienceOracle APEX migration to 5.1 - Our experience
Oracle APEX migration to 5.1 - Our experienceLino Schildenfeld
1.7K views37 slides
Creating Single Page Applications with Oracle Apex by
Creating Single Page Applications with Oracle ApexCreating Single Page Applications with Oracle Apex
Creating Single Page Applications with Oracle ApexDick Dral
3.5K views39 slides
A Primer on Web Components in APEX by
A Primer on Web Components in APEXA Primer on Web Components in APEX
A Primer on Web Components in APEXDimitri Gielis
1.5K views43 slides

What's hot(20)

Get the Look and Feel You Want in Oracle APEX by Jorge Rimblas
Get the Look and Feel You Want in Oracle APEXGet the Look and Feel You Want in Oracle APEX
Get the Look and Feel You Want in Oracle APEX
Jorge Rimblas7.3K views
How to make APEX print through Node.js by Dimitri Gielis
How to make APEX print through Node.jsHow to make APEX print through Node.js
How to make APEX print through Node.js
Dimitri Gielis28.9K views
COB - PowerApps - the good, the bad and the ugly - early 2018 by Chris O'Brien
COB - PowerApps - the good, the bad and the ugly - early 2018COB - PowerApps - the good, the bad and the ugly - early 2018
COB - PowerApps - the good, the bad and the ugly - early 2018
Chris O'Brien16.4K views
Oracle APEX migration to 5.1 - Our experience by Lino Schildenfeld
Oracle APEX migration to 5.1 - Our experienceOracle APEX migration to 5.1 - Our experience
Oracle APEX migration to 5.1 - Our experience
Lino Schildenfeld1.7K views
Creating Single Page Applications with Oracle Apex by Dick Dral
Creating Single Page Applications with Oracle ApexCreating Single Page Applications with Oracle Apex
Creating Single Page Applications with Oracle Apex
Dick Dral3.5K views
A Primer on Web Components in APEX by Dimitri Gielis
A Primer on Web Components in APEXA Primer on Web Components in APEX
A Primer on Web Components in APEX
Dimitri Gielis1.5K views
COB ESPC18 - Rich PowerApps with offline support by Chris O'Brien
COB ESPC18 - Rich PowerApps with offline supportCOB ESPC18 - Rich PowerApps with offline support
COB ESPC18 - Rich PowerApps with offline support
Chris O'Brien4.4K views
Moving your APEX app to the Oracle Exadata Express Cloud by Dimitri Gielis
Moving your APEX app to the Oracle Exadata Express CloudMoving your APEX app to the Oracle Exadata Express Cloud
Moving your APEX app to the Oracle Exadata Express Cloud
Dimitri Gielis768 views
Chris O'Brien - Modern SharePoint sites and the SharePoint Framework - reference by Chris O'Brien
Chris O'Brien - Modern SharePoint sites and the SharePoint Framework - referenceChris O'Brien - Modern SharePoint sites and the SharePoint Framework - reference
Chris O'Brien - Modern SharePoint sites and the SharePoint Framework - reference
Chris O'Brien21.6K views
Oracle application express ppt by Abhinaw Kumar
Oracle application express pptOracle application express ppt
Oracle application express ppt
Abhinaw Kumar7.5K views
Integration of APEX and Oracle Forms by Roel Hartman
Integration of APEX and Oracle FormsIntegration of APEX and Oracle Forms
Integration of APEX and Oracle Forms
Roel Hartman3.6K views
JavaScript straight from the Oracle Database by Dimitri Gielis
JavaScript straight from the Oracle DatabaseJavaScript straight from the Oracle Database
JavaScript straight from the Oracle Database
Dimitri Gielis3.4K views
Mastering universal theme by Roel Hartman
Mastering universal themeMastering universal theme
Mastering universal theme
Roel Hartman3.9K views
Chris OBrien - Pitfalls when developing with the SharePoint Framework (SPFx) by Chris O'Brien
Chris OBrien - Pitfalls when developing with the SharePoint Framework (SPFx)Chris OBrien - Pitfalls when developing with the SharePoint Framework (SPFx)
Chris OBrien - Pitfalls when developing with the SharePoint Framework (SPFx)
Chris O'Brien9.8K views
Reporting with Oracle Application Express (APEX) by Dimitri Gielis
Reporting with Oracle Application Express (APEX)Reporting with Oracle Application Express (APEX)
Reporting with Oracle Application Express (APEX)
Dimitri Gielis5.3K views
TypeScript and SharePoint Framework by Bob German
TypeScript and SharePoint FrameworkTypeScript and SharePoint Framework
TypeScript and SharePoint Framework
Bob German1.4K views
APEX Alpe Adria 2019 - JavaScript in APEX - do it right! by Marko Gorički
APEX Alpe Adria 2019 -  JavaScript in APEX - do it right!APEX Alpe Adria 2019 -  JavaScript in APEX - do it right!
APEX Alpe Adria 2019 - JavaScript in APEX - do it right!
Marko Gorički1.3K views
SharePoint PowerShell for the Admin and Developer - A Venn Diagram Experience by Ricardo Wilkins
SharePoint PowerShell for the Admin and Developer - A Venn Diagram ExperienceSharePoint PowerShell for the Admin and Developer - A Venn Diagram Experience
SharePoint PowerShell for the Admin and Developer - A Venn Diagram Experience
Ricardo Wilkins1.8K views
Can You Do That with APEX? Building Not So Straightforward Pages by Dimitri Gielis
Can You Do That with APEX? Building Not So Straightforward PagesCan You Do That with APEX? Building Not So Straightforward Pages
Can You Do That with APEX? Building Not So Straightforward Pages
Dimitri Gielis708 views

Viewers also liked

5 Cool Things you can do with HTML5 and APEX by
5 Cool Things you can do with HTML5 and APEX5 Cool Things you can do with HTML5 and APEX
5 Cool Things you can do with HTML5 and APEXRoel Hartman
6K views15 slides
Top 10 HTML5 features every developer should know! by
Top 10 HTML5 features every developer should know!Top 10 HTML5 features every developer should know!
Top 10 HTML5 features every developer should know!Gill Cleeren
1.3K views91 slides
APEX Dashboard Competition - Winners by
APEX Dashboard Competition - WinnersAPEX Dashboard Competition - Winners
APEX Dashboard Competition - WinnersTobias Arnhold
18.4K views11 slides
Building a Flexible UI with Oracle ApEx by
Building a Flexible UI with Oracle ApExBuilding a Flexible UI with Oracle ApEx
Building a Flexible UI with Oracle ApExBradley Brown
5.3K views40 slides
Challenges going mobile by
Challenges going mobileChallenges going mobile
Challenges going mobileChristian Rokitta
1.2K views24 slides
Создание веб-приложений с помощью Oracle APEX by
Создание веб-приложений с помощью Oracle APEX Создание веб-приложений с помощью Oracle APEX
Создание веб-приложений с помощью Oracle APEX CUSTIS
4.8K views24 slides

Viewers also liked(20)

5 Cool Things you can do with HTML5 and APEX by Roel Hartman
5 Cool Things you can do with HTML5 and APEX5 Cool Things you can do with HTML5 and APEX
5 Cool Things you can do with HTML5 and APEX
Roel Hartman6K views
Top 10 HTML5 features every developer should know! by Gill Cleeren
Top 10 HTML5 features every developer should know!Top 10 HTML5 features every developer should know!
Top 10 HTML5 features every developer should know!
Gill Cleeren1.3K views
APEX Dashboard Competition - Winners by Tobias Arnhold
APEX Dashboard Competition - WinnersAPEX Dashboard Competition - Winners
APEX Dashboard Competition - Winners
Tobias Arnhold18.4K views
Building a Flexible UI with Oracle ApEx by Bradley Brown
Building a Flexible UI with Oracle ApExBuilding a Flexible UI with Oracle ApEx
Building a Flexible UI with Oracle ApEx
Bradley Brown5.3K views
Создание веб-приложений с помощью Oracle APEX by CUSTIS
Создание веб-приложений с помощью Oracle APEX Создание веб-приложений с помощью Oracle APEX
Создание веб-приложений с помощью Oracle APEX
CUSTIS4.8K views
APEX 5 Demo and Best Practices by Dimitri Gielis
APEX 5 Demo and Best PracticesAPEX 5 Demo and Best Practices
APEX 5 Demo and Best Practices
Dimitri Gielis7.9K views
Advanced Reporting And Charting With Oracle Application Express 4.0 by Rinie Romme
Advanced Reporting And Charting With Oracle Application Express 4.0Advanced Reporting And Charting With Oracle Application Express 4.0
Advanced Reporting And Charting With Oracle Application Express 4.0
Rinie Romme15.7K views
PDB Provisioning with Oracle Multitenant Self Service Application by Leighton Nelson
PDB Provisioning with Oracle Multitenant Self Service ApplicationPDB Provisioning with Oracle Multitenant Self Service Application
PDB Provisioning with Oracle Multitenant Self Service Application
Leighton Nelson7.3K views
Offline Web with Oracle JET by andrejusb
Offline Web with Oracle JETOffline Web with Oracle JET
Offline Web with Oracle JET
andrejusb3.9K views
Jsf2 html5-jazoon by Roger Kitain
Jsf2 html5-jazoonJsf2 html5-jazoon
Jsf2 html5-jazoon
Roger Kitain5.8K views
Oracle APEX Performance by Scott Wesley
Oracle APEX PerformanceOracle APEX Performance
Oracle APEX Performance
Scott Wesley3.5K views
Top 5 Tips to Cut the Effort of your Oracle EBS R12 Project by a Third by Original Software
Top 5 Tips to Cut the Effort of your Oracle EBS R12 Project by a ThirdTop 5 Tips to Cut the Effort of your Oracle EBS R12 Project by a Third
Top 5 Tips to Cut the Effort of your Oracle EBS R12 Project by a Third
Original Software941 views
My Top 5 APEX JavaScript API's by Roel Hartman
My Top 5 APEX JavaScript API'sMy Top 5 APEX JavaScript API's
My Top 5 APEX JavaScript API's
Roel Hartman7.3K views
Oracle Application Express (APEX) and Microsoft Sharepoint integration by Dimitri Gielis
Oracle Application Express (APEX) and Microsoft Sharepoint integrationOracle Application Express (APEX) and Microsoft Sharepoint integration
Oracle Application Express (APEX) and Microsoft Sharepoint integration
Dimitri Gielis47K views
K TO 12 GRADE 1 LEARNING MATERIAL IN MUSIC (Q3-Q4) by LiGhT ArOhL
K TO 12 GRADE 1 LEARNING MATERIAL IN MUSIC (Q3-Q4)K TO 12 GRADE 1 LEARNING MATERIAL IN MUSIC (Q3-Q4)
K TO 12 GRADE 1 LEARNING MATERIAL IN MUSIC (Q3-Q4)
LiGhT ArOhL76.2K views

Similar to 5 x HTML5 worth using in APEX (5)

Html5 and web technology update by
Html5 and web technology updateHtml5 and web technology update
Html5 and web technology updateDoug Domeny
1.7K views23 slides
Html5 For Jjugccc2009fall by
Html5 For Jjugccc2009fallHtml5 For Jjugccc2009fall
Html5 For Jjugccc2009fallShumpei Shiraishi
1.9K views37 slides
HTML5 on Mobile by
HTML5 on MobileHTML5 on Mobile
HTML5 on MobileAdam Lu
8.4K views67 slides
Introduccion a HTML5 by
Introduccion a HTML5Introduccion a HTML5
Introduccion a HTML5Pablo Garaizar
3.9K views55 slides
html5 by
html5html5
html5NebberCracker01
708 views55 slides
GWT Extreme! by
GWT Extreme!GWT Extreme!
GWT Extreme!cromwellian
2.5K views51 slides

Similar to 5 x HTML5 worth using in APEX (5)(20)

Html5 and web technology update by Doug Domeny
Html5 and web technology updateHtml5 and web technology update
Html5 and web technology update
Doug Domeny1.7K views
HTML5 on Mobile by Adam Lu
HTML5 on MobileHTML5 on Mobile
HTML5 on Mobile
Adam Lu8.4K views
Mobile webapplication development by Ganesh Gembali
Mobile webapplication developmentMobile webapplication development
Mobile webapplication development
Ganesh Gembali818 views
Javascript first-class citizenery by toddbr
Javascript first-class citizeneryJavascript first-class citizenery
Javascript first-class citizenery
toddbr1.2K views
IE 8 et les standards du Web - Chris Wilson - Paris Web 2008 by Association Paris-Web
IE 8 et les standards du Web - Chris Wilson - Paris Web 2008IE 8 et les standards du Web - Chris Wilson - Paris Web 2008
IE 8 et les standards du Web - Chris Wilson - Paris Web 2008
Html5 drupal7 with mandakini kumari(1) by Mandakini Kumari
Html5 drupal7 with mandakini kumari(1)Html5 drupal7 with mandakini kumari(1)
Html5 drupal7 with mandakini kumari(1)
Mandakini Kumari1.5K views
Building AOL's High Performance, Enterprise Wide Mail Application With Silver... by goodfriday
Building AOL's High Performance, Enterprise Wide Mail Application With Silver...Building AOL's High Performance, Enterprise Wide Mail Application With Silver...
Building AOL's High Performance, Enterprise Wide Mail Application With Silver...
goodfriday948 views
Speak the Web 15.02.2010 by Patrick Lauke
Speak the Web 15.02.2010Speak the Web 15.02.2010
Speak the Web 15.02.2010
Patrick Lauke1.1K views
Cape Cod Web Technology Meetup - 2 by Asher Martin
Cape Cod Web Technology Meetup - 2Cape Cod Web Technology Meetup - 2
Cape Cod Web Technology Meetup - 2
Asher Martin283 views
Event-driven IO server-side JavaScript environment based on V8 Engine by Ricardo Silva
Event-driven IO server-side JavaScript environment based on V8 EngineEvent-driven IO server-side JavaScript environment based on V8 Engine
Event-driven IO server-side JavaScript environment based on V8 Engine
Ricardo Silva4.1K views

More from Christian Rokitta

Keep me moving goin mobile by
Keep me moving   goin mobileKeep me moving   goin mobile
Keep me moving goin mobileChristian Rokitta
285 views41 slides
Hitchhiker's guide to the Universal Theme by
Hitchhiker's guide to the Universal ThemeHitchhiker's guide to the Universal Theme
Hitchhiker's guide to the Universal ThemeChristian Rokitta
892 views57 slides
Browser Developer Tools for APEX Developers by
Browser Developer Tools for APEX DevelopersBrowser Developer Tools for APEX Developers
Browser Developer Tools for APEX DevelopersChristian Rokitta
1.1K views30 slides
Bootstrapify Universal Theme by
Bootstrapify Universal ThemeBootstrapify Universal Theme
Bootstrapify Universal ThemeChristian Rokitta
2K views52 slides
Plugins unplugged by
Plugins unpluggedPlugins unplugged
Plugins unpluggedChristian Rokitta
665 views47 slides
APEX & Cookie Monster by
APEX & Cookie MonsterAPEX & Cookie Monster
APEX & Cookie MonsterChristian Rokitta
2K views22 slides

More from Christian Rokitta(10)

Recently uploaded

Citi TechTalk Session 2: Kafka Deep Dive by
Citi TechTalk Session 2: Kafka Deep DiveCiti TechTalk Session 2: Kafka Deep Dive
Citi TechTalk Session 2: Kafka Deep Diveconfluent
17 views60 slides
A first look at MariaDB 11.x features and ideas on how to use them by
A first look at MariaDB 11.x features and ideas on how to use themA first look at MariaDB 11.x features and ideas on how to use them
A first look at MariaDB 11.x features and ideas on how to use themFederico Razzoli
45 views36 slides
DSD-INT 2023 Thermobaricity in 3D DCSM-FM - taking pressure into account in t... by
DSD-INT 2023 Thermobaricity in 3D DCSM-FM - taking pressure into account in t...DSD-INT 2023 Thermobaricity in 3D DCSM-FM - taking pressure into account in t...
DSD-INT 2023 Thermobaricity in 3D DCSM-FM - taking pressure into account in t...Deltares
9 views26 slides
SUGCON ANZ Presentation V2.1 Final.pptx by
SUGCON ANZ Presentation V2.1 Final.pptxSUGCON ANZ Presentation V2.1 Final.pptx
SUGCON ANZ Presentation V2.1 Final.pptxJack Spektor
22 views34 slides
DevsRank by
DevsRankDevsRank
DevsRankdevsrank786
11 views1 slide
DSD-INT 2023 FloodAdapt - A decision-support tool for compound flood risk mit... by
DSD-INT 2023 FloodAdapt - A decision-support tool for compound flood risk mit...DSD-INT 2023 FloodAdapt - A decision-support tool for compound flood risk mit...
DSD-INT 2023 FloodAdapt - A decision-support tool for compound flood risk mit...Deltares
13 views34 slides

Recently uploaded(20)

Citi TechTalk Session 2: Kafka Deep Dive by confluent
Citi TechTalk Session 2: Kafka Deep DiveCiti TechTalk Session 2: Kafka Deep Dive
Citi TechTalk Session 2: Kafka Deep Dive
confluent17 views
A first look at MariaDB 11.x features and ideas on how to use them by Federico Razzoli
A first look at MariaDB 11.x features and ideas on how to use themA first look at MariaDB 11.x features and ideas on how to use them
A first look at MariaDB 11.x features and ideas on how to use them
Federico Razzoli45 views
DSD-INT 2023 Thermobaricity in 3D DCSM-FM - taking pressure into account in t... by Deltares
DSD-INT 2023 Thermobaricity in 3D DCSM-FM - taking pressure into account in t...DSD-INT 2023 Thermobaricity in 3D DCSM-FM - taking pressure into account in t...
DSD-INT 2023 Thermobaricity in 3D DCSM-FM - taking pressure into account in t...
Deltares9 views
SUGCON ANZ Presentation V2.1 Final.pptx by Jack Spektor
SUGCON ANZ Presentation V2.1 Final.pptxSUGCON ANZ Presentation V2.1 Final.pptx
SUGCON ANZ Presentation V2.1 Final.pptx
Jack Spektor22 views
DSD-INT 2023 FloodAdapt - A decision-support tool for compound flood risk mit... by Deltares
DSD-INT 2023 FloodAdapt - A decision-support tool for compound flood risk mit...DSD-INT 2023 FloodAdapt - A decision-support tool for compound flood risk mit...
DSD-INT 2023 FloodAdapt - A decision-support tool for compound flood risk mit...
Deltares13 views
Fleet Management Software in India by Fleetable
Fleet Management Software in India Fleet Management Software in India
Fleet Management Software in India
Fleetable11 views
360 graden fabriek by info33492
360 graden fabriek360 graden fabriek
360 graden fabriek
info3349224 views
Advanced API Mocking Techniques by Dimpy Adhikary
Advanced API Mocking TechniquesAdvanced API Mocking Techniques
Advanced API Mocking Techniques
Dimpy Adhikary19 views
2023-November-Schneider Electric-Meetup-BCN Admin Group.pptx by animuscrm
2023-November-Schneider Electric-Meetup-BCN Admin Group.pptx2023-November-Schneider Electric-Meetup-BCN Admin Group.pptx
2023-November-Schneider Electric-Meetup-BCN Admin Group.pptx
animuscrm13 views
DSD-INT 2023 The Danube Hazardous Substances Model - Kovacs by Deltares
DSD-INT 2023 The Danube Hazardous Substances Model - KovacsDSD-INT 2023 The Danube Hazardous Substances Model - Kovacs
DSD-INT 2023 The Danube Hazardous Substances Model - Kovacs
Deltares7 views
.NET Developer Conference 2023 - .NET Microservices mit Dapr – zu viel Abstra... by Marc Müller
.NET Developer Conference 2023 - .NET Microservices mit Dapr – zu viel Abstra....NET Developer Conference 2023 - .NET Microservices mit Dapr – zu viel Abstra...
.NET Developer Conference 2023 - .NET Microservices mit Dapr – zu viel Abstra...
Marc Müller38 views
DSD-INT 2023 Wave-Current Interaction at Montrose Tidal Inlet System and Its ... by Deltares
DSD-INT 2023 Wave-Current Interaction at Montrose Tidal Inlet System and Its ...DSD-INT 2023 Wave-Current Interaction at Montrose Tidal Inlet System and Its ...
DSD-INT 2023 Wave-Current Interaction at Montrose Tidal Inlet System and Its ...
Deltares9 views
DSD-INT 2023 Leveraging the results of a 3D hydrodynamic model to improve the... by Deltares
DSD-INT 2023 Leveraging the results of a 3D hydrodynamic model to improve the...DSD-INT 2023 Leveraging the results of a 3D hydrodynamic model to improve the...
DSD-INT 2023 Leveraging the results of a 3D hydrodynamic model to improve the...
Deltares6 views
DSD-INT 2023 European Digital Twin Ocean and Delft3D FM - Dols by Deltares
DSD-INT 2023 European Digital Twin Ocean and Delft3D FM - DolsDSD-INT 2023 European Digital Twin Ocean and Delft3D FM - Dols
DSD-INT 2023 European Digital Twin Ocean and Delft3D FM - Dols
Deltares7 views
DSD-INT 2023 Modelling litter in the Yarra and Maribyrnong Rivers (Australia)... by Deltares
DSD-INT 2023 Modelling litter in the Yarra and Maribyrnong Rivers (Australia)...DSD-INT 2023 Modelling litter in the Yarra and Maribyrnong Rivers (Australia)...
DSD-INT 2023 Modelling litter in the Yarra and Maribyrnong Rivers (Australia)...
Deltares9 views

5 x HTML5 worth using in APEX (5)

  • 1. 5 x HTML5 in APEX (5) Christian Rokitta HTML5 + APEX5 = Perfect 10 (Shakeeb)
  • 2. Program • HTML 5 – What‘s new? • HTML5 Tags o <dialog> element: Modals made easy o <output> • HTML5 API’s o Drag and Drop o Geolocation API o SSE
  • 3. Why HTML5? • Multiple Devices (Mobile, Mobile, Mobile) • Modular • Multimedia • Semantics (cleaner code, accessibility) • Interactivity (tighter integration with JavaScript) • Structure vs Presentation, CSS3
  • 4. What is New in HTML5? • Simplified DOCTYPE: <!DOCTYPE html> • New HTML Elements • HTML APIs • Elements Removed in HTML5  CSS <center>, <frame>/<frameset>, <big>, <font>, …
  • 5. Standard? Sorry, not yet. Version Year Tim Berners-Lee invented www 1989 Tim Berners-Lee invented HTML 1991 Dave Raggett drafted HTML+ 1993 HTML Working Group defined HTML 2.0 1995 W3C Recommended HTML 3.2 1997 W3C Recommended HTML 4.01 1999 W3C Recommended XHTML 1.0 2000 HTML5 WHATWG* First Public Draft 2008 HTML5 WHATWG Living Standard 2012 HTML5 W3C Final Recommendation 2014 *) Web Hypertext Application Technology Working Group - was formed in response to slow W3C development, and W3C's decision to close down the development of HTML, in favor of XHTML
  • 6. HTML5 New Elements • Semantic/Structural Elements <article>, <aside>, <dialog> <footer>, <header>, <menuitem>, <nav>, <section>, … • Form Elements <datalist>, <output>, … • Input Types tel, timcolor, date, email, number,search, e, url, … • Input Attributes autocomplete, autofocus, min/max, placeholder, … • New Attribute Syntax <input type="text" value=John>, <input type="text" value='John Doe'>, … • HTML5 Graphics <canvas>, <svg> • New Media Elements <audio>, <video>, <track>, …
  • 7. <dialog> element: Modals made easy <table> <tr> <th>January <dialog open>This is an open dialog window</dialog></th> <th>February</th> <th>March</th> </tr> <tr> <td>31</td> <td>28</td> <td>31</td> </tr> </table> <table> <tr> <th>January <dialog>This is an open dialog window</dialog></th> <th>February</th> <th>March</th> </tr> <tr> <td>31</td> <td>28</td> <td>31</td> </tr> </table>
  • 8. <dialog> element: specs • show(): Open dialog. • close(): Close dialog. Takes an optional argument which if present dialog.returnValue is set to. • showModal(): Open modal dialog. • ::backdrop: Pseudo-element to style background behind a modal dialog. • close event: Fired when a dialog is closed. • cancel event: Fired when the Escape key is pressed on a modal dialog.
  • 10. <dialog>, some final questions • Why do we need <dialog> element while it's possible using libraries? o great for accessibility o modal dialogs are pushed on a well-ordered stack (no z- index) • How do I position a dialog? CSS! default CSS includes "position: absolute; left: 0; right: 0; margin: auto;" which horizontally centers the element within its container. • Can I open multiple dialogs? Yes. Much like multiple <div> elements stacked on eachother.
  • 11. <output> element: input Antipode <form> <label for="ticketcount">Number of passes</label> <input type="number" name="ticketcount" id="ticketcount" min="1" max="12" value="1" onchange="spinny()"> <span id="price">@ $25 per ticket</span> = <output name="total" for="ticketcount price">$25</output> </form> var total = document.querySelector('output[name="total"]'); var ticketcount = document.getElementById('ticketcount'); function spinny() { total.value = "$" + parseInt(ticketcount.value) * 25; }
  • 12. <output> element: specs <form oninput="x.value=parseInt(a.value)+parseInt(b.value)">0 <input type="range" id="a" value="50">100 +<input type="number" id="b" value="50"> =<output name="x" for="a b"></output> </form> HTML5 valueAsNumber input element property: <form oninput="x.value=a.valueAsNumber+b.valueAsNumber">0 <input type="range" id="a" value="50">100 +<input type="number" id="b" value="50"> =<output name="x" for="a b"></output> </form>
  • 13. <output> element: Attributes Attribute Value Description for element_id Specifies the relationship between the result of the calculation, and the elements used in the calculation form form_id Specifies one or more forms the output element belongs to name name Specifies a name for the output element
  • 15. Drag and Drop API Drag and drop is a very common feature. It is when you "grab" an object and drag it to a different location. In HTML5, drag and drop is part of the standard, and any element can be draggable.
  • 16. Drag and Drop Example <!DOCTYPE HTML> <html> <head> <script> function allowDrop(ev) { ev.preventDefault(); } function drag(ev) { ev.dataTransfer.setData("text", ev.target.id); } function drop(ev) { ev.preventDefault(); var data = ev.dataTransfer.getData("text"); ev.target.appendChild(document.getElementById(data)); } </script> </head> <body> <div id="div1" ondrop="drop(event)" ondragover="allowDrop(event)"></div> <img id="drag1" src="img_logo.gif" draggable="true" ondragstart="drag(event)" width="336" height="69"> </body> </html>
  • 17. Parts of a Drag and Drop event • Make an Element Draggable <img draggable="true"> • What to Drag - ondragstart and setData() function drag(ev) { ev.dataTransfer.setData("text", ev.target.id); } • Where to Drop – ondragover event.preventDefault() • Do the Drop - ondrop function drop(ev) { ev.preventDefault(); var data = ev.dataTransfer.getData("text"); ev.target.appendChild(document.getElementById(data)); }
  • 19. Geolocation API The HTML Geolocation API is used to get the geographical position of a user/device*. Since this can compromise user privacy, the position is not available unless the user approves it. *) accurate for devices with GPS
  • 20. Using HTML Geolocation <script> var x = document.getElementById("demo"); function getLocation() { if (navigator.geolocation) { navigator.geolocation.getCurrentPosition(showPosition); } else { x.innerHTML = "Geolocation is not supported by this browser."; } } function showPosition(position) { x.innerHTML = "Latitude: " + position.coords.latitude + "<br>Longitude: " + position.coords.longitude; } </script>
  • 21. Geolocation Example explained • Check if Geolocation is supported • If supported, run the getCurrentPosition() method. If not, display a message to the user • If the getCurrentPosition() method is successful, it returns a coordinates object to the function specified in the parameter ( showPosition ) • The showPosition() function gets the displays the Latitude and Longitude
  • 22. Handling Errors and Rejections navigator.geolocation.getCurrentPosition(showPosition,showError); function showError(error) { switch(error.code) { case error.PERMISSION_DENIED: x.innerHTML = "User denied the request for Geolocation." break; case error.POSITION_UNAVAILABLE: x.innerHTML = "Location information is unavailable." break; case error.TIMEOUT: x.innerHTML = "The request to get user location timed out." break; case error.UNKNOWN_ERROR: x.innerHTML = "An unknown error occurred." break; } }
  • 23. getCurrentPosition() - Return Data Property Description coords.latitude The latitude as a decimal number coords.longitude The longitude as a decimal number coords.accuracy The accuracy of position coords.altitude The altitude in meters above the mean sea level coords.altitudeAccuracy The altitude accuracy of position coords.heading The heading as degrees clockwise from North coords.speed The speed in meters per second timestamp The date/time of the response The getCurrentPosition() method returns an object if it is successful. The latitude, longitude and accuracy properties are always returned. The other properties below are returned if available.
  • 24. Geolocation - Other Methods id = navigator.geolocation.watchPosition( success , error , options); options = { enableHighAccuracy: false , timeout: 5000 , maximumAge: 0 }; navigator.geolocation.clearWatch(id);
  • 26. Server-Sent Events - One Way Messaging • A server-sent event is when a web page automatically gets updates from a server. • A web app "subscribes" to a stream of updates generated by a server and, whenever a new event occurs, a notification is triggered on the client.
  • 27. Server-Sent Events vs. WebSockets Websockets: • APIs like WebSockets provide a richer protocol to perform bi-directional, full-duplex communication. • Two-way channel is more attractive for things like games, messaging apps, and for cases where you need near real-time updates in both directions.
  • 28. Server-Sent Events vs. WebSockets Server-Send Events: • Two-way channel is more attractive for things like games, messaging apps, and for cases where you need near real-time updates in both directions. • SSE in favor when you simply need updates from some server action. If you'll need to send data to a server, XMLHttpRequest is always a friend.
  • 29. Server-Sent Events vs. WebSockets SSEs are sent over traditional HTTP. That means they do not require a special protocol or server implementation to get working. WebSockets on the other hand, require full- duplex connections and new Web Socket servers to handle the protocol. In addition, Server-Sent Events have a variety of features that WebSockets lack by design such as automatic reconnection, event IDs.
  • 30. SSE API - subscribe to an event stream if (!!window.EventSource) { var source = new EventSource('stream.php'); } else { // Result to xhr polling :( } URL passed to the EventSource constructor is an absolute URL, its origin (scheme, domain, port) must match that of the calling page
  • 31. SSE API - handler for the message event source.addEventListener('message', function(e) { console.log(e.data); }, false); Optioneel: source.addEventListener('open', function(e) { // Connection was opened. }, false); source.addEventListener('error', function(e) { if (e.readyState == EventSource.CLOSED) { // Connection was closed. } }, false);
  • 32. SSE API • When updates are pushed from the server, the onmessage handler fires and new data is be available in its e.data property. • The magical part is that whenever the connection is closed, the browser will automatically reconnect to the source after ~3 seconds. • Your server implementation can even have control over this reconnection timeout. • That's it.
  • 33. SSE - Event Stream Format Plaintext response, served with a text/event-stream Content-Type, that follows the SSE format. In its basic form, the response should contain a "data:" line, followed by your message, followed by two "n" characters to end the stream: data: My messagenn Multiline Data: data: first linen data: second linenn
  • 34. SSE - Send JSON Data data: {n data: "msg": "hello world",n data: "id": 12345n data: }nn source.addEventListener('message', function(e) { var data = JSON.parse(e.data); console.log(data.id, data.msg); }, false );
  • 35. SSE - Controlling the Reconnection- timeout The browser attempts to reconnect to the source roughly 3 seconds after each connection is closed. You can change that timeout by including a line beginning with "retry:", followed by the number of milliseconds to wait before trying to reconnect. The following example attempts a reconnect after 10 seconds: retry: 10000n data: hello worldnn
  • 36. SSE Server – APEX Before Header Proces DECLARE dummy VARCHAR2(10); BEGIN sys.HTP.flush; sys.HTP.init; sys.OWA_UTIL.mime_header('text/event-stream', FALSE); sys.OWA_UTIL.http_header_close; sys.HTP.p('retry: 10000'); sys.HTP.p('data: {'); sys.HTP.p('data: "msg": "hello world",'); sys.HTP.p('data: "id": 12345'); sys.HTP.p('data: }'); sys.HTP.p(dummy); APEX_APPLICATION.stop_apex_engine; END;
  • 38. 10. Juni, 11:00 – 11:45, Landskrone