15
Vaadin 7 coding UI components August 2013 Benjamin Schupp mp technology consulting GmbH

Vaadin7 coding ui components

Embed Size (px)

DESCRIPTION

Slides vom Vaadin BBQ 8.8.2013 bei mp technology in Zürich. Talk zum Thema Erstellung von Vaadin 7 Erweiterungen auf Browserseite von Benjamin Schupp, Lead Architect, mp technology. http://www.mptechnology.ch

Citation preview

Page 1: Vaadin7   coding ui components

Vaadin 7coding UI components

August 2013

Benjamin Schuppmp technology consulting GmbH

Page 2: Vaadin7   coding ui components

© mp technology consulting GmbH & Vaadin Ltd | August 2013 | Page 2

Mission: Create Vaadin component for a jquery plugin ‚qrcode‘

Page 3: Vaadin7   coding ui components

© mp technology consulting GmbH & Vaadin Ltd | August 2013 | Page 3

Understanding Vaadin

Page 4: Vaadin7   coding ui components

© mp technology consulting GmbH & Vaadin Ltd | August 2013 | Page 4

Application Architecture

• UI Model stored as component tree on server

• Rendering in browser via GWT Widgets

• Communication through json (UIDL)

Page 5: Vaadin7   coding ui components

© mp technology consulting GmbH & Vaadin Ltd | August 2013 | Page 5

UI Component Architecture

Java• Compiled with JDK

HTTP(S)Client UI

Component• Rendering• Event handling• Runs on JavaScript

Server UI

Component• State• Button, Table…• Java API to program

Java• Google Web Toolkit• Compiled to

JavaScript

Page 6: Vaadin7   coding ui components

© mp technology consulting GmbH & Vaadin Ltd | August 2013 | Page 6

Vaadin Architecture

Page 7: Vaadin7   coding ui components

© mp technology consulting GmbH & Vaadin Ltd | August 2013 | Page 7

Extending VaadinUnderstand the options

1. Use existing add-ons from the directory- 3rd party or own- No implementation necessary

- Example: - Vaadin Charts- Calendar

Page 8: Vaadin7   coding ui components

© mp technology consulting GmbH & Vaadin Ltd | August 2013 | Page 8

Extending VaadinUnderstand the options

2. Create CustomComponent- Composition of existing built-in components- Server-side implementation only

- Example: Reoccuring dialog

Page 9: Vaadin7   coding ui components

© mp technology consulting GmbH & Vaadin Ltd | August 2013 | Page 9

Extending VaadinUnderstand the options

3. Component Extensions- Add features to existing components without

inheritance- Server-side component and client-side connector

implementation

- Example: Add a caps-lock warning to fields

Page 10: Vaadin7   coding ui components

© mp technology consulting GmbH & Vaadin Ltd | August 2013 | Page 10

Extending VaadinUnderstand the options

4. Integrate JavaScript libraries/code- Server-side component and client-side connector

implementation- Automatic delivery of JavaScript libraries by framework

- Example: In a minute

Page 11: Vaadin7   coding ui components

© mp technology consulting GmbH & Vaadin Ltd | August 2013 | Page 11

Extending VaadinUnderstand the options

5. Client side widget implementation- Use/extend existing widgets- Compose existing GWT widgets- Create own widget implementation

(create DOM manually)

- GWT programming model!(Recompile widgetset)

Page 12: Vaadin7   coding ui components

© mp technology consulting GmbH & Vaadin Ltd | August 2013 | Page 12

Packaging a custom Widget

• For a Vaadin add-on create proper MANIFEST file (see dev.vaadin.com/wiki/VaadinAddon)

• Don‘t forget to include the sources • Upload to VAADIN directory

Page 13: Vaadin7   coding ui components

© mp technology consulting GmbH & Vaadin Ltd | August 2013 | Page 13

Client – ServerIntegration

Page 14: Vaadin7   coding ui components

© mp technology consulting GmbH & Vaadin Ltd | August 2013 | Page 14

Sample code…

Page 15: Vaadin7   coding ui components

© mp technology consulting GmbH & Vaadin Ltd | August 2013 | Page 15

• Individual-Software für Intranet und Internet und Mobile seit 2003

• Beratung, Analyse, Konzepte, Architektur, Implementierung

• Zertifizierter Vaadin Solution Partner

• http://www.mptechnology.ch

Offizielle Vaadin Schulungen in Zürich

• 11. – 12. November 2013: Vaadin 7 Fundamentals

• 13. – 14. November 2013: Advanced Vaadin 7

• Anmeldung über https://vaadin.com/services#vaadintraining

mp technology, Zürich