SlideShare ist ein Scribd-Unternehmen logo
1 von 115
Downloaden Sie, um offline zu lesen
Vaadin 7

              Joonas Lehtinen / Vaadin


                                         @joonaslehtinen
               12-5-17
17. toukokuuta 12
Quick intro to
                        Vaadin
                    Framework



17. toukokuuta 12
Vaadin is a
                    UI framework
                     for rich web
                     applications


17. toukokuuta 12
java     html

17. toukokuuta 12
Developer
                    experience
     goals          User
                    expecience
                    Scalability

17. toukokuuta 12
123
17. toukokuuta 12
                    ideas
17. toukokuuta 12
                     1
                    powerful
                    components
User Inteface
                    Data Source
                       Theme

17. toukokuuta 12
17. toukokuuta 12
17. toukokuuta 12
17. toukokuuta 12
17. toukokuuta 12
User Inteface
                    Data Source
                       Theme

17. toukokuuta 12
Reindeer
                      Runo
                    Chameleon
                     Custom
17. toukokuuta 12
User Inteface
                    Data Source
                       Theme

17. toukokuuta 12
17. toukokuuta 12
InMemory, Bean, Method,
     Collection, JDBC, JPA,
     Hibernate, TextFile,
     FileSystem, Properties,
     EclipseLink, Lucene,
     Mockups, GAE, ... Your’s

17. toukokuuta 12
17. toukokuuta 12
                    2
                    combine the best of
                    • Server-side RIA
                    • Google Web Toolkit
Layers of abstraction
                   backend frontend
                                                  RPC         browser browser
                    server   server
                   any language   any language   json / xml     java   ➠   javascript
ExtJS GWT Vaadin




                   required       required       optional     optional     optional


                   required       required       required     required     optional


                   required       required       required        X         required


 17. toukokuuta 12
How does it
                    work, really?


17. toukokuuta 12
17. toukokuuta 12
•   Initial HTML
                    •   CSS (theme)
                    •   Images
                    •   JavaScript

                    830k total
                           compress

                    250k
                           reduced
                           widgetset

                    120k

17. toukokuuta 12
• name=”Joonas”
                    • button clicked
                    150 bytes




17. toukokuuta 12
17. toukokuuta 12
• name=”Joonas”
                    • button clicked
                    150 bytes



                    • Add
                      notification
                    466 bytes

17. toukokuuta 12
Vaadin UI component
    architecture
                                       HTTP(S)
          “UI Component”                         “Widget”
          • Button, Table, Tree, ...             • Client-side peer for
          • Server-side data                       the component
          • Full Java API                        • Runs on JavaScript




               Java                               Java

               • Compiled with JDK                • Google Web Toolkit



17. toukokuuta 12
Creating new UI
                    components is
                    really easy


17. toukokuuta 12
17. toukokuuta 12
Implement two classes

     Server-side                                Client-side

          “UI Component”            Automatic    “Widget”
          • Define API                            • Render to DOM
          • Receive client events                • Collect user events
          • Send UI updates
            back




17. toukokuuta 12
17. toukokuuta 12
17. toukokuuta 12
17. toukokuuta 12
17. toukokuuta 12
17. toukokuuta 12
PaperStack notes = new PaperStack();
!
! @Override
! public void init() {

            // === Layout ========================================================
!   !       HorizontalLayout lo= new HorizontalLayout();
!   !       Window mainWindow = new Window("Postitnotes Application", lo);
!   !       lo.setSizeFull();
!   !       lo.addComponent(notes);
!   !       lo.setComponentAlignment(notes, Alignment.MIDDLE_CENTER);
!   !       setMainWindow(mainWindow);!!
!   !       notes.setWidth("350px");
!   !       notes.setHeight("350px");
!   !
            // === Note 1 ========================================================
! !         notes.addComponent(new Label("<h1>TODO / Today</h1><div style='font-size: 24px'>” +
               “<p>Enjoy the conference...</p></div>", Label.CONTENT_XHTML), "#fef49c");

            // === Note 2 ========================================================
! !         notes.addComponent(new Label("<h1>TODO / Tomorrow</h1><div style='font-size: 24px'>” +
               “<p>Learn Vaadin!</p></div>", Label.CONTENT_XHTML), "#b2ffa1");

            // === Note 3 ========================================================
! !         notes.addComponent(new Label("<div style='font-size: 60px'><center><br/><br/><br/>” +
               “DOUBLE<br/><br/><br/>SPEED</center></div>", Label.CONTENT_XHTML), "#b2ffa1");

            // === Note 4 ========================================================
!   !       com.vaadin.ui.RichTextArea rta = new RichTextArea();
!   !       rta.setSizeFull();
!   !       notes.addComponent(rta);
!   !       rta.setValue("<span style='font-size: 35pt; color: green;'>You can use any “ +
               “Vaadin components here...</span>");
! }

17. toukokuuta 12
PaperStack notes = new PaperStack();
!
! @Override
! public void init() {

            // === Layout ========================================================
!   !       HorizontalLayout lo= new HorizontalLayout();
!   !       Window mainWindow = new Window("Postitnotes Application", lo);
!   !       lo.setSizeFull();
!   !       lo.addComponent(notes);
!   !       lo.setComponentAlignment(notes, Alignment.MIDDLE_CENTER);
!   !       setMainWindow(mainWindow);!!
!   !       notes.setWidth("350px");
!   !       notes.setHeight("350px");
!   !
            // === Note 1 ========================================================
! !         notes.addComponent(new Label("<h1>TODO / Today</h1><div style='font-size: 24px'>” +
               “<p>Enjoy the conference...</p></div>", Label.CONTENT_XHTML), "#fef49c");

            // === Note 2 ========================================================
! !         notes.addComponent(new Label("<h1>TODO / Tomorrow</h1><div style='font-size: 24px'>” +
               “<p>Learn Vaadin!</p></div>", Label.CONTENT_XHTML), "#b2ffa1");

            // === Note 3 ========================================================
! !         notes.addComponent(new Label("<div style='font-size: 60px'><center><br/><br/><br/>” +
               “DOUBLE<br/><br/><br/>SPEED</center></div>", Label.CONTENT_XHTML), "#b2ffa1");

            // === Note 4 ========================================================
!   !       com.vaadin.ui.RichTextArea rta = new RichTextArea();
!   !       rta.setSizeFull();
!   !       notes.addComponent(rta);
!   !       rta.setValue("<span style='font-size: 35pt; color: green;'>You can use any “ +
               “Vaadin components here...</span>");
! }

17. toukokuuta 12
17. toukokuuta 12
                    3
                    embrace
                    java
Any JVM
                    Language


17. toukokuuta 12
Scalawith Scaladin add-on
       val layout =
         new VerticalLayout(width = 100 pct, height = 100 pct) {
             add(new Label(content = "Persons"))
             add(new Table(width = 100 pct, height = 100 pct),
                 ratio = 1)
             add(new HorizontalLayout(spacing = true) {
                 add(new Button("Edit selected", _ => editClicked()))
                 add(new Button("Add new", _ => addNewClicked()))
              })
         }
       getMainWindow.setContent(layout)




17. toukokuuta 12
Internet Explorer
                    6..
                             Chrome
                              Firefox
                               Safari
                               Opera
                                 iOS
                             Android

17. toukokuuta 12
No
                      browser
                       plugins
                    Nothing to
                        install

17. toukokuuta 12
Servlet
                          Portlet
                    (most) clouds


17. toukokuuta 12
Apache Tomcat, version 4.1 or later
                    Oracle WebLogic Server, version 9.2 or later
                    Oracle WebLogic Portal, version 10gR3
                    IBM WebSphere Application Server, version 6.1 or later
                    IBM WebSphere Portal, version 6.1 and 7.0
                    JBoss Application Server, version 3.2.8 or later
                    Jetty, version 5 or later
                    Glassfish, version 2 or later
                    Liferay Portal 5.2 or later
                    GateIn Portal 3.1
                    eXo Platform 3
                    Google App Engine
                    Vaadin supports Java Servlet API 2.3
                     and JSR-168 and JSR-286 Portlet
                    Specifications and should work with
                    any Java application server that conforms
                    to these standards.
17. toukokuuta 12
Eclipse
                    IntelliJ IDEA
                       Netbeans
                           Maven
                               Ant
                     Spring Roo
                                ∙∙∙

17. toukokuuta 12
17. toukokuuta 12
Maven
                mvn archetype:generate
                -DarchetypeGroupId=com.vaadin
                -DarchetypeArtifactId=
                      vaadin-archetype-clean

                    mvn package        yourproject-1.0.war



17. toukokuuta 12
17. toukokuuta 12
                    Vaadin


                          7
                    Framework
History
                    When What

                     2001 Millstone Framework is born

                     2002 Released as Open Source




                                                          Server-side API compatible
                     2005 Ajax based rendering

                     2008 Google Web Toolkit integrated

                     2009 Renamed to Vaadin

                     2010 Add-ons

17. toukokuuta 12
Heavily under
                    construction
                    [ to be released on Q4 ]



17. toukokuuta 12
vaadin.com/roadmap
17. toukokuuta 12
17. toukokuuta 12
                    Empower Developers




                    Embrace Extendability




                          Clean Up
Empower Developers   View Management
                               Redesign
                               • Remove "browser window"
                               • HttpRequest access
                               • View management API
                               • Simplified Application API
                                 by removing unnecessary
                                 abstractions
                               • Multitab support by default
17. toukokuuta 12
public class Vaadin6testApplication extends Application {

  	 public void init() {
  	 	 Window mainWindow = new Window("V6test Application");
  	 	 setMainWindow(mainWindow);

  	 	 mainWindow.addComponent(new TextField("What is your name"));
  	 	 mainWindow.addComponent(new Button("Do not push me"));
  	 }

  }




17. toukokuuta 12
17. toukokuuta 12
17. toukokuuta 12
public class V6testApplication extends Application {

              	     public void init() {
              	     	 setMainWindow(createWindow());
              	     }

              	     public Window getWindow(String name) {
              	     	 Window window = super.getWindow(name);
              	     	 if (window == null) {
              	     	 	 window = createWindow();
              	     	 	 window.setName(name);
              	     	 	 addWindow(window);
              	     	 }
              	     	 return window;
              	     }

              	     private Window createWindow() {
              	     	 Window window = new Window("V6test Application");
              	     	 window.addComponent(new TextField("What is your name"));
              	     	 window.addComponent(new Button("Do not push me"));
              	     	 return window;
              	     }

              }


17. toukokuuta 12
public class Vaadin7testRoot extends Root {

      	      public void init(WrappedRequest request) {
      	      	 addComponent(new TextField("What is your name"));
      	      	 addComponent(new Button("Do not push me"));
      	      }

      }




17. toukokuuta 12
Warning: Naming might
                    be changed from “Root”
                    to “Region”




17. toukokuuta 12
public class Vaadin6Application extends Application {

     	     public void init() {
     	     	 Window window = new Window("V6test Application");
     	     	 setMainWindow(window);

     	     	        final Label label = new Label();
     	     	        final UriFragmentUtility fragment = new UriFragmentUtility();
     	     	        window.addComponent(fragment);

     	     	        window.addComponent(label);
     	     	
     	     	        fragment.addListener(new UriFragmentUtility.FragmentChangedListener() {
     	     	        	 public void fragmentChanged(FragmentChangedEvent source) {
     	     	        	 	 label.setValue(fragment.getFragment());
     	     	        	 }
     	     	        });
     	     }

     }




17. toukokuuta 12
public class V7testRoot extends Root {

            	 public void init(WrappedRequest request) {
            	 	 addComponent(new Label(getFragment()));
            	 }

            }




17. toukokuuta 12
public class V7testRoot extends Root {

   	 public void init(WrappedRequest request) {

   	 	 final Label label = new Label(getFragment());
   	 	 addComponent(label);

   	     	     addListener(new FragmentChangedListener() {
   	     	     	 public void fragmentChanged(FragmentChangedEvent event) {
   	     	     	 	 label.setValue(getFragment());
   	     	     	 }
   	     	     });
   	     }

   }




17. toukokuuta 12
Most of the changes
                    already available Alpha 1

                    View management API
                    in Alpha 3 to be
                    released in June


17. toukokuuta 12
Empower Developers   Full CSS Control
                               • Layout calculations are
                                 managed by browser
                                 • Improved performance
                                 • Support border/margin/...
                                 • Drop support for IE6/IE7
                               • CSS abstraction language
                               • Inject CSS from Java
                               • Per component selectors

17. toukokuuta 12
.v-connector {
                       -webkit-box-sizing: border-box;
                       -moz-box-sizing: border-box;
                       box-sizing: border-box;
                    }

17. toukokuuta 12
private final ElementResizeListener listener = new ElementResizeListener() {
       public void onElementResize(ElementResizeEvent e) {
           int buttonWidth = getLayoutManager().getOuterWidth(e.getElement());
           buttonWidth -= getLayoutManager().getMarginRight(e.getElement());
           getWidget().adjustButtonSpace(buttonWidth);
       }
   };

   @Override
   protected void init() {
       Element button = getWidget().getWidget(1).getElement();
       getLayoutManager().addElementResizeListener(button, listener);
   }

   @Override
   public void onUnregister() {
       Element button = getWidget().getWidget(1).getElement();
       getLayoutManager().removeElementResizeListener(button, listener);
   }




17. toukokuuta 12
Alpha 2 implements lots of
                    layout performance
                    improvements, but work is
                    still unfinished.



17. toukokuuta 12
or




17. toukokuuta 12
Empower Developers   Glue for Integrations
                               • Publish JavaScript API
                                 from the server-side
                                 • Integrate easily with the
                                   rest of the web page
                               • Tag lib to ease integration
                                 with JSP/JSF
                               • Centralized shared resource
                                 loading (JS/CSS)

17. toukokuuta 12
Empower Developers   Live Translations
                               • Built in translator API
                               • Custom translation stores
                               • Translated transparently on
                                 client-server communication
                               • Switch languages on fly
                               • Strings and resources



17. toukokuuta 12
Easier Client-Server
                               Embrace Extendability
          Empower Developers
                                                       Communications
                                                       • Client-server RPC API
                                                       • Shared state API
                                                       • Phase out “variables” and
                                                         “attributes”




17. toukokuuta 12
Widget
                                                   6
                                Paintable
                     Variable
 client             Changes


 server
                                            UIDL


                            Component


17. toukokuuta 12
Widget
                                    7
                    Connector

 client
                                State
 server
                    RPC


                    Component


17. toukokuuta 12
State
                    Bean with most Java types: integers,
                    Strings, lists, maps, ...


                    All server-side changes automatically sent
                    to client.


                    Connectors can access all states of
                    children and parent components



17. toukokuuta 12
RPC                    public interface ButtonRpc extends ServerRpc {
                               public void click(MouseEventDetails details);
    client to server       }
    example




                                                  private ButtonRpc rpc = new ButtonRpc() {
                                                     public void click(
 private ButtonRpc rpc =                               MouseEventDetails details) {
 RpcProxy.create(ButtonRpc.class, this);                   // do stuff
                                                     }
 public void onClick(ClickEvent event) {          };
   rpc.click(
      new MouseEventDetails(event));              public Button() {
 }                                                  registerRpc(rpc);
                                                  }




                                  client         server
17. toukokuuta 12
Already done in Alpha 2,
                    start trying these out
                    today...




17. toukokuuta 12
New Extension
                               Embrace Extendability
          Empower Developers
                                                       Points
                                                       • ApplicationServlet plug-ins
                                                       • “Non-widget” add-ons
                                                       • Component decorator for
                                                         extending without extend
                                                       • Server-push plug-in API
                                                         • Plug-in for push
                                                       • State storage plug-ins
17. toukokuuta 12
Generic JavaScript
                               Embrace Extendability
          Empower Developers
                                                       Widget Wrapper
                                                       • Convert existing 3rd party
                                                         widgets to Vaadin
                                                       • GWT compilation not
                                                         required




17. toukokuuta 12
Ease Common
                               Embrace Extendability
          Empower Developers
                                                       Extensions
                                                       • Allow easy packaging of
                                                         CSS and images with
                                                         server-side compositions
                                                       • Simplify Component
                                                         Container API to make
                                                         implementation easier


17. toukokuuta 12
Data Binding and
          Embrace Extendability
          Empower Developers
               Clean Up           Form redesign
                                  • Form binding and layout are
                                    cleanly separated
                                  • Explicit property convertters
                                  • Two phase commit support
                                  • Built-in JSR-303 validations
                                  • Backwards compatibility
                                    helper as add-on
17. toukokuuta 12
Converters



17. toukokuuta 12
public class Name {
        private String firstName;
        private String lastName;

               public Name(String firstName, String lastName) {
                   this.firstName = firstName;
                   this.lastName = lastName;
               }

               // Setters and getters

    }




17. toukokuuta 12
“Joonas Lehtinen”



 presentation
                         Component
 model




                     firstName = “Joonas”
                    lastName = “Lehtinen”

17. toukokuuta 12
public class StringToNameConverter implements Converter<String, Name> {

        public Name convertToModel(String text, Locale locale)
                throws ConversionException {
            if (text == null) {
                return null;
            }
            String[] parts = text.split(" ");
            if (parts.length != 2) {
                throw new ConversionException("Can not convert text to a name: "
                        + text);
            }
            return new Name(parts[0], parts[1]);
        }

        public String convertToPresentation(Name name, Locale locale)
                throws ConversionException {
            if (name == null) {
                return null;
            } else {
                return name.getFirstName() + " " + name.getLastName();
            }
        }

        public Class<Name> getModelType() {
            return Name.class;
        }

        public Class<String> getPresentationType() {
            return String.class;
        }
}
17. toukokuuta 12
Name name = new Name("Rudolph", "Reindeer");

        final TextField textField = new TextField("Name");

        textField.setConverter(new StringToNameConverter());

        // ....

        Name name = (Name) textField.getConvertedValue();




17. toukokuuta 12
public class MyStringToDoubleConverter extends
     StringToDoubleConverter {

                @Override
                protected NumberFormat getFormat(Locale locale) {
                    NumberFormat format = super.getFormat(locale);
                    format.setGroupingUsed(false);
                    format.setMaximumFractionDigits(3);
                    format.setMinimumFractionDigits(3);
                    return format;
                }
     }




17. toukokuuta 12
public class MyConverterFactory extends DefaultConverterFactory {

               @Override
               protected <PRESENTATION, MODEL>
                   Converter<PRESENTATION, MODEL> findConverter(
                       Class<PRESENTATION> presentationType,
                       Class<MODEL> modelType) {

                    // Handle String <-> Double
                    if (presentationType == String.class &&
                        modelType == Double.class) {
                        return (Converter<PRESENTATION, MODEL>)
                           new MyStringToDoubleConverter();
                    }

                    // Let default factory handle the rest
                    return super.findConverter(presentationType, modelType);
               }
     }

     getApplication().setConverterFactory(new MyConverterFactory());




17. toukokuuta 12
table.setConverter(PERCENT_PROPERTY,
       new StringToNumberConverter() {
         @Override
         protected NumberFormat getFormat(Locale locale) {
             return NumberFormat.getPercentInstance(locale);
         }
     });

     table.setConverter(CURRENCY_PROPERTY,
       new StringToNumberConverter() {
         @Override
         protected NumberFormat getFormat(Locale locale) {
             return NumberFormat.getCurrencyInstance(locale);
         }
     });




17. toukokuuta 12
Validation



17. toukokuuta 12
public class Person {

                    @Size(min = 5, max = 50)
                    private String name;

                    @Min(0)
                    @Max(100)
                    private int age;

                    // + constructor + setters + getters
   }



17. toukokuuta 12
Person person = new Person("John", 26);
BeanItem<Person> item = new
    BeanItem<Person>(person);

TextField firstName = new TextField("First name",
        item.getItemProperty("name"));

firstName.addValidator(new
    BeanValidator(Person.class, "name"));




17. toukokuuta 12
FieldGroup



17. toukokuuta 12
public class Employee {
                    	 String firstName;
                    	 String lastName;
                    	 double salary;
                    	 Date birthDate;

                         // Getters, setters, …
                    }

                    Form form = new Form();

                    form.setItemDataSource(
                       new BeanItem<Employee>(employee));




17. toukokuuta 12
17. toukokuuta 12
Form form = new Form() {
	    	     	 @Override
	    	     	 protected void attachField(Object propertyId, Field field) {
	    	     	 	 // Some custom logic for placing components
	    	     	 }
	    	     };




17. toukokuuta 12
form.setFormFieldFactory(new FormFieldFactory() {

         	     	    	   public Field createField(Item item, Object propertyId,
         	     	    	   	 	 Component uiContext) {

         	     	    	   	   if ("salary".equals(propertyId)) {
         	     	    	   	   	 TextField tf = new TextField();
         	     	    	   	   	 tf.setWidth("7em");
         	     	    	   	   	 return tf;
         	     	    	   	   } else if ("birthDate".equals(propertyId)) {
         	     	    	   	   	 DateField df = new DateField();
         	     	    	   	   	 df.setResolution(DateField.RESOLUTION_DAY);
         	     	    	   	   	 return df;
         	     	    	   	   } else {
         	     	    	   	   	 // ..
         	     	    	   	   }

         	     	    	 	     return DefaultFieldFactory.createFieldByPropertyType(item
         	     	    	 	     	 	 .getItemProperty(propertyId).getType());
         	     	    	 }
         	     	    });



17. toukokuuta 12
FormLayout form = new FormLayout() {

    	     	     	   TextField   firstName = new TextField("First name");
    	     	     	   TextField   lastName = new TextField("Last name");
    	     	     	   TextField   salary = new TextField("Salary");
    	     	     	   DateField   birthDate = new DateField("Birth date");

    	     	     	 {
    	     	     	 	   birthDate.setResolution(Resolution.DAY);
    	     	     	 	   addComponent(firstName);
    	     	     	 	   addComponent(lastName);
    	     	     	 	   addComponent(birthDate);
    	     	     	 	   addComponent(salary);
    	     	     	 }
    	     	     };




17. toukokuuta 12
final BeanFieldGroup<Employee> fieldGroup =
	 	 	 new BeanFieldGroup<Employee>(Employee.class);

	 fieldGroup.bindMemberFields(form);

	 fieldGroup.setItemDataSource(new BeanItem<Employee>(employee));




17. toukokuuta 12
17. toukokuuta 12
GridLayout form = new GridLayout(2,2) {

	     	      	     TextField   firstName = new TextField("First name");
	     	      	     TextField   lastName = new TextField("Last name");
	     	      	     TextField   salary = new TextField("Salary");
	     	      	     DateField   birthDate = new DateField("Birth date");

	     	      	 {
	     	      	 	        birthDate.setResolution(Resolution.DAY);
	     	      	 	        setSpacing(true);
	     	      	 	        addComponent(firstName);
	     	      	 	        addComponent(lastName);
	     	      	 	        addComponent(birthDate);
	     	      	 	        addComponent(salary);
	     	      	 }
	     	      };


    17. toukokuuta 12
17. toukokuuta 12
Client-side
          Embrace Extendability
          Empower Developers

                                  • Review widgetset API
                                  • Ease client-side logic
               Clean Up

                                  • Decouple communication
                                    from core widgets thoughtout
                                    Vaadin 7 series
                                    • Client-side compositions
                                    • Support GWT Designer
                                  • Better support for multiple
                                    Vaadin apps per Page
17. toukokuuta 12
Improved session
          Embrace Extendability
          Empower Developers
               Clean Up           management
                                  • Kill all “out-of-sync” errors
                                  • Default to one server Window
                                    Root per page
                                  • Default to keeping sessions
                                    live while page is shown



17. toukokuuta 12
HTML
          Embrace Extendability
          Empower Developers

                                  • Simpler DOM as IE6/IE7 is
                                    not supported any more
               Clean Up

                                  • WAI-ARIA support
                                  • Built in HTML sanitation to
                                   improve security




17. toukokuuta 12
Old API
          Embrace Extendability
          Empower Developers

                                  • Replace integer constants with
                                    enums
               Clean Up

                                  • Remove the unnecessary
                                    Container.Ordered interface
                                  • Remove deprecated APIs




17. toukokuuta 12
17. toukokuuta 12
                    Empower Developers




                    Embrace Extendability




                          Clean Up
Changes to roadmap
                    are expected.

                    Almost certainly some
                    things will be postponed
                    to 7.1.


17. toukokuuta 12
Vaadin 7.1
                    • Table redesign
                    • Things postponed from 7.0




17. toukokuuta 12
more
                    info


17. toukokuuta 12
Find out more at
                    vaadin.com/wiki



17. toukokuuta 12
Roots (Windows)
             •      Creating a basic application
             •      Creating multi tab applications
             •      Defining the theme for a Root
             •      Using URI fragments
             •      Finding the current Root and Application
             •      Using URI or parameters or screen size when initializing an application
             •      Generating dynamic resources based on URI or parameters
             •      Creating an application that preserves state on refresh
             •      Creating an application with different features for different clients




17. toukokuuta 12
Form & Data binding
        •   Formatting data in Table
        •   Creating a TextField for Integer only input using a data source
        •   Creating a TextField for Integer only input when not using a data source
        •   Creating your own converter for String <-> MyType conversion
        •   Changing the default converters for an application
        •   Creating a master-details view for editing persons
        •   Auto generating a form based on a bean - Vaadin 6 style Form
        •   Creating a form using an existing layout
        •   Using Bean Validation to validate input
        •   Creating a custom field for editing the address of a person




17. toukokuuta 12
Custom widgets
           • Creating a simple component
           • Using Shared State for communication
           • Sending events from the client to the server using RPC
           • Using RPC to send events to the client
           • Using Components in the shared state
           • Using Resources in the shared state
           • Integrating an existing GWT widget
           • Creating a simple component container
           • Widget styling using only CSS
           • Lightweight calculations of widget layout
           • Complex widget layouts



17. toukokuuta 12
Download for Free
          vaadin.com/book




     Vaadin is
                a
    for build n open source
              ing mod        J
   look gre          ern web ava framework
             at,            applicat
   your use perform well a           ion
             rs happ        nd make s that
                    y.                you and
    http://va
             adin.com
                     /



SBN 978
        -9   52-92-67
                     53-8
                            90000

9 7 8 95 2
           9    267538
 $29.95




                                                4th Editio
                                                          n




          674 pages
   17. toukokuuta 12
brought to you by...
 #85
   Get More Refcardz! Visit refcardz.com


                                           CONTENTS INCLUDE:
                                           About Vaadin


                                                                                     Getting Started with Vaadin
                                           Creating An Application
                                           Components
                                           Layout Components
                                           Themes
                                           Data Binding and more...
                                                                                                                                                              By Marko Grönroos

                                                ABOUT VAADIN                                                         Web
                                                                                                                     Browser                                                              External
                                                                                                                     Client-Side                                                          Resources
                                            Vaadin is a server-side Ajax web application development                 Engine
                                            framework that allows you to build web applications just like                     AJAX Requests

                                            with traditional desktop frameworks, such as AWT or Swing. An                                         Servlet Container
                                                                                                                     Java                                                                 File
                                            application is built from user interface components contained            Servlet                                                              Resources
                                            hierarchically in layout components.
                                                                                                                                                          Data
                                            In the server-driven model, the application code runs on                 Application            UI            Binding     Default
                                                                                                                     Class                  Component                 Theme
                                            a server, while the actual user interaction is handled by a
                                            client-side engine running in the browser. The client-server           Inherits        Events     Changes               Inherits

                                            communications and any client-side technologies, such as                 User             Event        Data              Application   Application
                                            HTML and JavaScript, are invisible to the developer. As the              Application      Listener     Model             Themes        Resources
                                            client-side engine runs as JavaScript in the browser, there is no
                                            need to install plug-ins. Vaadin is released under the Apache                                            Database
                                            License 2.0.
                                             Web             Java         Vaadin          Your             Web    Figure 2: Architecture for Vaadin Applications
                                             Browser         Web          UI              Java          Service
                                             Client-Side     Server       Components      Application
                                                                                                                                    You can get a reference to the application object
   w.dzone.com




                                             Engine                                                        EJB          Hot
                                                                                                                        Tip         from any component attached to the application with
                                                                                                            DB

                                                                                                                  Event Listeners
                                            Figure 1: Vaadin Client-Server Architecture
                                                                                                                  In the event-driven model, user interaction with user interface
                  If the built-in selection of components is not enough, you can
                                                                                                                  components triggers server-side events, which you can handle
17. toukokuuta 12 develop new components with the Google Web Toolkit (GWT)
Expert services
                                      Better
                      Online support
                                      Results
                             Training
                                      Faster
                               Tools
                             vaadin.com/pro




             Questions?

                                                joonas@vaadin.com
                                                  vaadin.com/joonas
            12-5-17                                 @joonaslehtinen
17. toukokuuta 12

Weitere ähnliche Inhalte

Was ist angesagt?

Getting Started with HTML5 in Tech Com (STC 2012)
Getting Started with HTML5 in Tech Com (STC 2012)Getting Started with HTML5 in Tech Com (STC 2012)
Getting Started with HTML5 in Tech Com (STC 2012)Peter Lubbers
 
Hyperproductive JSF 2.0 @ JavaOne Brazil 2010
Hyperproductive JSF 2.0 @ JavaOne Brazil 2010Hyperproductive JSF 2.0 @ JavaOne Brazil 2010
Hyperproductive JSF 2.0 @ JavaOne Brazil 2010Arun Gupta
 
Varnish Cache and its usage in the real world!
Varnish Cache and its usage in the real world!Varnish Cache and its usage in the real world!
Varnish Cache and its usage in the real world!Ivan Chepurnyi
 
Web components with java by Haijian Wang
Web components with java by Haijian WangWeb components with java by Haijian Wang
Web components with java by Haijian WangGWTcon
 
Performance Improvements in Browsers
Performance Improvements in BrowsersPerformance Improvements in Browsers
Performance Improvements in Browsersjeresig
 
High Performance Ajax Applications
High Performance Ajax ApplicationsHigh Performance Ajax Applications
High Performance Ajax ApplicationsJulien Lecomte
 
Keypoints html5
Keypoints html5Keypoints html5
Keypoints html5dynamis
 
Developing High Performance Web Apps
Developing High Performance Web AppsDeveloping High Performance Web Apps
Developing High Performance Web AppsTimothy Fisher
 
Everything is Awesome - Cutting the Corners off the Web
Everything is Awesome - Cutting the Corners off the WebEverything is Awesome - Cutting the Corners off the Web
Everything is Awesome - Cutting the Corners off the WebJames Rakich
 
Tuning Web Performance
Tuning Web PerformanceTuning Web Performance
Tuning Web PerformanceEric ShangKuan
 
jQuery Mobile & PhoneGap
jQuery Mobile & PhoneGapjQuery Mobile & PhoneGap
jQuery Mobile & PhoneGapSwiip
 
Aligning Ember.js with Web Standards
Aligning Ember.js with Web StandardsAligning Ember.js with Web Standards
Aligning Ember.js with Web StandardsMatthew Beale
 
Core data WIPJam workshop @ MWC'14
Core data WIPJam workshop @ MWC'14Core data WIPJam workshop @ MWC'14
Core data WIPJam workshop @ MWC'14Diego Freniche Brito
 
Future of Java EE with SE 8 (revised)
Future of Java EE with SE 8 (revised)Future of Java EE with SE 8 (revised)
Future of Java EE with SE 8 (revised)Hirofumi Iwasaki
 
Angular vs React for Web Application Development
Angular vs React for Web Application DevelopmentAngular vs React for Web Application Development
Angular vs React for Web Application DevelopmentFITC
 
Developing web applications in 2010
Developing web applications in 2010Developing web applications in 2010
Developing web applications in 2010Ignacio Coloma
 
User Interface Patterns and Nuxeo
User Interface Patterns and NuxeoUser Interface Patterns and Nuxeo
User Interface Patterns and Nuxeoanicewick
 
WordPress Performance Optimization for Mere Mortals
WordPress Performance Optimization for Mere MortalsWordPress Performance Optimization for Mere Mortals
WordPress Performance Optimization for Mere MortalsJohn Levandowski
 

Was ist angesagt? (20)

Getting Started with HTML5 in Tech Com (STC 2012)
Getting Started with HTML5 in Tech Com (STC 2012)Getting Started with HTML5 in Tech Com (STC 2012)
Getting Started with HTML5 in Tech Com (STC 2012)
 
Hyperproductive JSF 2.0 @ JavaOne Brazil 2010
Hyperproductive JSF 2.0 @ JavaOne Brazil 2010Hyperproductive JSF 2.0 @ JavaOne Brazil 2010
Hyperproductive JSF 2.0 @ JavaOne Brazil 2010
 
Varnish Cache and its usage in the real world!
Varnish Cache and its usage in the real world!Varnish Cache and its usage in the real world!
Varnish Cache and its usage in the real world!
 
AspNetWhitePaper
AspNetWhitePaperAspNetWhitePaper
AspNetWhitePaper
 
Web components with java by Haijian Wang
Web components with java by Haijian WangWeb components with java by Haijian Wang
Web components with java by Haijian Wang
 
Performance Improvements in Browsers
Performance Improvements in BrowsersPerformance Improvements in Browsers
Performance Improvements in Browsers
 
High Performance Ajax Applications
High Performance Ajax ApplicationsHigh Performance Ajax Applications
High Performance Ajax Applications
 
Keypoints html5
Keypoints html5Keypoints html5
Keypoints html5
 
Developing High Performance Web Apps
Developing High Performance Web AppsDeveloping High Performance Web Apps
Developing High Performance Web Apps
 
HTML 5 - Overview
HTML 5 - OverviewHTML 5 - Overview
HTML 5 - Overview
 
Everything is Awesome - Cutting the Corners off the Web
Everything is Awesome - Cutting the Corners off the WebEverything is Awesome - Cutting the Corners off the Web
Everything is Awesome - Cutting the Corners off the Web
 
Tuning Web Performance
Tuning Web PerformanceTuning Web Performance
Tuning Web Performance
 
jQuery Mobile & PhoneGap
jQuery Mobile & PhoneGapjQuery Mobile & PhoneGap
jQuery Mobile & PhoneGap
 
Aligning Ember.js with Web Standards
Aligning Ember.js with Web StandardsAligning Ember.js with Web Standards
Aligning Ember.js with Web Standards
 
Core data WIPJam workshop @ MWC'14
Core data WIPJam workshop @ MWC'14Core data WIPJam workshop @ MWC'14
Core data WIPJam workshop @ MWC'14
 
Future of Java EE with SE 8 (revised)
Future of Java EE with SE 8 (revised)Future of Java EE with SE 8 (revised)
Future of Java EE with SE 8 (revised)
 
Angular vs React for Web Application Development
Angular vs React for Web Application DevelopmentAngular vs React for Web Application Development
Angular vs React for Web Application Development
 
Developing web applications in 2010
Developing web applications in 2010Developing web applications in 2010
Developing web applications in 2010
 
User Interface Patterns and Nuxeo
User Interface Patterns and NuxeoUser Interface Patterns and Nuxeo
User Interface Patterns and Nuxeo
 
WordPress Performance Optimization for Mere Mortals
WordPress Performance Optimization for Mere MortalsWordPress Performance Optimization for Mere Mortals
WordPress Performance Optimization for Mere Mortals
 

Ähnlich wie Vaadin7

企业级软件的组件化和动态化开发实践
企业级软件的组件化和动态化开发实践企业级软件的组件化和动态化开发实践
企业级软件的组件化和动态化开发实践Jacky Chi
 
Silicon Valley CodeCamp 2008: High performance Ajax with ExtJS and ASP.NET
Silicon Valley CodeCamp 2008: High performance Ajax with ExtJS and ASP.NETSilicon Valley CodeCamp 2008: High performance Ajax with ExtJS and ASP.NET
Silicon Valley CodeCamp 2008: High performance Ajax with ExtJS and ASP.NETMats Bryntse
 
Gatsby (Code.Talks) 2019
Gatsby (Code.Talks) 2019Gatsby (Code.Talks) 2019
Gatsby (Code.Talks) 2019Stefan Adolf
 
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!
APEX Alpe Adria 2019 - JavaScript in APEX - do it right!Marko Gorički
 
sbt 0.10 for beginners?
sbt 0.10 for beginners?sbt 0.10 for beginners?
sbt 0.10 for beginners?k4200
 
Meetup Performance
Meetup PerformanceMeetup Performance
Meetup PerformanceGreg Whalin
 
Jaxitalia09 Spring Best Practices
Jaxitalia09 Spring Best PracticesJaxitalia09 Spring Best Practices
Jaxitalia09 Spring Best PracticesMassimiliano Dessì
 
Server Side Javascript
Server Side JavascriptServer Side Javascript
Server Side Javascriptrajivmordani
 
Vaadin Introduction at OOP 2014
Vaadin Introduction at OOP 2014Vaadin Introduction at OOP 2014
Vaadin Introduction at OOP 2014Johannes Eriksson
 
"I have a framework idea" - Repeat less, share more.
"I have a framework idea" - Repeat less, share more."I have a framework idea" - Repeat less, share more.
"I have a framework idea" - Repeat less, share more.Fabio Milano
 
Spark IT 2011 - Simplified Web Development using Java Server Faces 2.0
Spark IT 2011 - Simplified Web Development using Java Server Faces 2.0Spark IT 2011 - Simplified Web Development using Java Server Faces 2.0
Spark IT 2011 - Simplified Web Development using Java Server Faces 2.0Arun Gupta
 
CollabSphere 2021 - DEV114 - The Nuts and Bolts of CI/CD With a Large XPages ...
CollabSphere 2021 - DEV114 - The Nuts and Bolts of CI/CD With a Large XPages ...CollabSphere 2021 - DEV114 - The Nuts and Bolts of CI/CD With a Large XPages ...
CollabSphere 2021 - DEV114 - The Nuts and Bolts of CI/CD With a Large XPages ...Jesse Gallagher
 
Nuxt.JS Introdruction
Nuxt.JS IntrodructionNuxt.JS Introdruction
Nuxt.JS IntrodructionDavid Ličen
 
Web Apps and more
Web Apps and moreWeb Apps and more
Web Apps and moreYan Shi
 

Ähnlich wie Vaadin7 (20)

企业级软件的组件化和动态化开发实践
企业级软件的组件化和动态化开发实践企业级软件的组件化和动态化开发实践
企业级软件的组件化和动态化开发实践
 
Spring & SpringBatch EN
Spring & SpringBatch ENSpring & SpringBatch EN
Spring & SpringBatch EN
 
Silicon Valley CodeCamp 2008: High performance Ajax with ExtJS and ASP.NET
Silicon Valley CodeCamp 2008: High performance Ajax with ExtJS and ASP.NETSilicon Valley CodeCamp 2008: High performance Ajax with ExtJS and ASP.NET
Silicon Valley CodeCamp 2008: High performance Ajax with ExtJS and ASP.NET
 
Gatsby (Code.Talks) 2019
Gatsby (Code.Talks) 2019Gatsby (Code.Talks) 2019
Gatsby (Code.Talks) 2019
 
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!
APEX Alpe Adria 2019 - JavaScript in APEX - do it right!
 
Having Fun with Play
Having Fun with PlayHaving Fun with Play
Having Fun with Play
 
sbt 0.10 for beginners?
sbt 0.10 for beginners?sbt 0.10 for beginners?
sbt 0.10 for beginners?
 
Meetup Performance
Meetup PerformanceMeetup Performance
Meetup Performance
 
Meetup Performance
Meetup PerformanceMeetup Performance
Meetup Performance
 
Jaxitalia09 Spring Best Practices
Jaxitalia09 Spring Best PracticesJaxitalia09 Spring Best Practices
Jaxitalia09 Spring Best Practices
 
UNO based ODF Toolkit API
UNO based ODF Toolkit APIUNO based ODF Toolkit API
UNO based ODF Toolkit API
 
Server Side Javascript
Server Side JavascriptServer Side Javascript
Server Side Javascript
 
Vaadin Introduction at OOP 2014
Vaadin Introduction at OOP 2014Vaadin Introduction at OOP 2014
Vaadin Introduction at OOP 2014
 
"I have a framework idea" - Repeat less, share more.
"I have a framework idea" - Repeat less, share more."I have a framework idea" - Repeat less, share more.
"I have a framework idea" - Repeat less, share more.
 
Spark IT 2011 - Simplified Web Development using Java Server Faces 2.0
Spark IT 2011 - Simplified Web Development using Java Server Faces 2.0Spark IT 2011 - Simplified Web Development using Java Server Faces 2.0
Spark IT 2011 - Simplified Web Development using Java Server Faces 2.0
 
WSS And Share Point For Developers
WSS And Share Point For DevelopersWSS And Share Point For Developers
WSS And Share Point For Developers
 
CollabSphere 2021 - DEV114 - The Nuts and Bolts of CI/CD With a Large XPages ...
CollabSphere 2021 - DEV114 - The Nuts and Bolts of CI/CD With a Large XPages ...CollabSphere 2021 - DEV114 - The Nuts and Bolts of CI/CD With a Large XPages ...
CollabSphere 2021 - DEV114 - The Nuts and Bolts of CI/CD With a Large XPages ...
 
Nuxt.JS Introdruction
Nuxt.JS IntrodructionNuxt.JS Introdruction
Nuxt.JS Introdruction
 
Create a new project in ROR
Create a new project in RORCreate a new project in ROR
Create a new project in ROR
 
Web Apps and more
Web Apps and moreWeb Apps and more
Web Apps and more
 

Kürzlich hochgeladen

What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfMounikaPolabathina
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersRaghuram Pandurangan
 
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESmohitsingh558521
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Manik S Magar
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfLoriGlavin3
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsNathaniel Shimoni
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxLoriGlavin3
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxLoriGlavin3
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxLoriGlavin3
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 

Kürzlich hochgeladen (20)

What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdf
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information Developers
 
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdf
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directions
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 

Vaadin7

  • 1. Vaadin 7 Joonas Lehtinen / Vaadin @joonaslehtinen 12-5-17 17. toukokuuta 12
  • 2. Quick intro to Vaadin Framework 17. toukokuuta 12
  • 3. Vaadin is a UI framework for rich web applications 17. toukokuuta 12
  • 4. java html 17. toukokuuta 12
  • 5. Developer experience goals User expecience Scalability 17. toukokuuta 12
  • 7. 17. toukokuuta 12 1 powerful components
  • 8. User Inteface Data Source Theme 17. toukokuuta 12
  • 13. User Inteface Data Source Theme 17. toukokuuta 12
  • 14. Reindeer Runo Chameleon Custom 17. toukokuuta 12
  • 15. User Inteface Data Source Theme 17. toukokuuta 12
  • 17. InMemory, Bean, Method, Collection, JDBC, JPA, Hibernate, TextFile, FileSystem, Properties, EclipseLink, Lucene, Mockups, GAE, ... Your’s 17. toukokuuta 12
  • 18. 17. toukokuuta 12 2 combine the best of • Server-side RIA • Google Web Toolkit
  • 19. Layers of abstraction backend frontend RPC browser browser server server any language any language json / xml java ➠ javascript ExtJS GWT Vaadin required required optional optional optional required required required required optional required required required X required 17. toukokuuta 12
  • 20. How does it work, really? 17. toukokuuta 12
  • 22. Initial HTML • CSS (theme) • Images • JavaScript 830k total compress 250k reduced widgetset 120k 17. toukokuuta 12
  • 23. • name=”Joonas” • button clicked 150 bytes 17. toukokuuta 12
  • 25. • name=”Joonas” • button clicked 150 bytes • Add notification 466 bytes 17. toukokuuta 12
  • 26. Vaadin UI component architecture HTTP(S) “UI Component” “Widget” • Button, Table, Tree, ... • Client-side peer for • Server-side data the component • Full Java API • Runs on JavaScript Java Java • Compiled with JDK • Google Web Toolkit 17. toukokuuta 12
  • 27. Creating new UI components is really easy 17. toukokuuta 12
  • 29. Implement two classes Server-side Client-side “UI Component” Automatic “Widget” • Define API • Render to DOM • Receive client events • Collect user events • Send UI updates back 17. toukokuuta 12
  • 35. PaperStack notes = new PaperStack(); ! ! @Override ! public void init() { // === Layout ======================================================== ! ! HorizontalLayout lo= new HorizontalLayout(); ! ! Window mainWindow = new Window("Postitnotes Application", lo); ! ! lo.setSizeFull(); ! ! lo.addComponent(notes); ! ! lo.setComponentAlignment(notes, Alignment.MIDDLE_CENTER); ! ! setMainWindow(mainWindow);!! ! ! notes.setWidth("350px"); ! ! notes.setHeight("350px"); ! ! // === Note 1 ======================================================== ! ! notes.addComponent(new Label("<h1>TODO / Today</h1><div style='font-size: 24px'>” + “<p>Enjoy the conference...</p></div>", Label.CONTENT_XHTML), "#fef49c"); // === Note 2 ======================================================== ! ! notes.addComponent(new Label("<h1>TODO / Tomorrow</h1><div style='font-size: 24px'>” + “<p>Learn Vaadin!</p></div>", Label.CONTENT_XHTML), "#b2ffa1"); // === Note 3 ======================================================== ! ! notes.addComponent(new Label("<div style='font-size: 60px'><center><br/><br/><br/>” + “DOUBLE<br/><br/><br/>SPEED</center></div>", Label.CONTENT_XHTML), "#b2ffa1"); // === Note 4 ======================================================== ! ! com.vaadin.ui.RichTextArea rta = new RichTextArea(); ! ! rta.setSizeFull(); ! ! notes.addComponent(rta); ! ! rta.setValue("<span style='font-size: 35pt; color: green;'>You can use any “ + “Vaadin components here...</span>"); ! } 17. toukokuuta 12
  • 36. PaperStack notes = new PaperStack(); ! ! @Override ! public void init() { // === Layout ======================================================== ! ! HorizontalLayout lo= new HorizontalLayout(); ! ! Window mainWindow = new Window("Postitnotes Application", lo); ! ! lo.setSizeFull(); ! ! lo.addComponent(notes); ! ! lo.setComponentAlignment(notes, Alignment.MIDDLE_CENTER); ! ! setMainWindow(mainWindow);!! ! ! notes.setWidth("350px"); ! ! notes.setHeight("350px"); ! ! // === Note 1 ======================================================== ! ! notes.addComponent(new Label("<h1>TODO / Today</h1><div style='font-size: 24px'>” + “<p>Enjoy the conference...</p></div>", Label.CONTENT_XHTML), "#fef49c"); // === Note 2 ======================================================== ! ! notes.addComponent(new Label("<h1>TODO / Tomorrow</h1><div style='font-size: 24px'>” + “<p>Learn Vaadin!</p></div>", Label.CONTENT_XHTML), "#b2ffa1"); // === Note 3 ======================================================== ! ! notes.addComponent(new Label("<div style='font-size: 60px'><center><br/><br/><br/>” + “DOUBLE<br/><br/><br/>SPEED</center></div>", Label.CONTENT_XHTML), "#b2ffa1"); // === Note 4 ======================================================== ! ! com.vaadin.ui.RichTextArea rta = new RichTextArea(); ! ! rta.setSizeFull(); ! ! notes.addComponent(rta); ! ! rta.setValue("<span style='font-size: 35pt; color: green;'>You can use any “ + “Vaadin components here...</span>"); ! } 17. toukokuuta 12
  • 37. 17. toukokuuta 12 3 embrace java
  • 38. Any JVM Language 17. toukokuuta 12
  • 39. Scalawith Scaladin add-on val layout = new VerticalLayout(width = 100 pct, height = 100 pct) { add(new Label(content = "Persons")) add(new Table(width = 100 pct, height = 100 pct), ratio = 1) add(new HorizontalLayout(spacing = true) { add(new Button("Edit selected", _ => editClicked())) add(new Button("Add new", _ => addNewClicked())) }) } getMainWindow.setContent(layout) 17. toukokuuta 12
  • 40. Internet Explorer 6.. Chrome Firefox Safari Opera iOS Android 17. toukokuuta 12
  • 41. No browser plugins Nothing to install 17. toukokuuta 12
  • 42. Servlet Portlet (most) clouds 17. toukokuuta 12
  • 43. Apache Tomcat, version 4.1 or later Oracle WebLogic Server, version 9.2 or later Oracle WebLogic Portal, version 10gR3 IBM WebSphere Application Server, version 6.1 or later IBM WebSphere Portal, version 6.1 and 7.0 JBoss Application Server, version 3.2.8 or later Jetty, version 5 or later Glassfish, version 2 or later Liferay Portal 5.2 or later GateIn Portal 3.1 eXo Platform 3 Google App Engine Vaadin supports Java Servlet API 2.3 and JSR-168 and JSR-286 Portlet Specifications and should work with any Java application server that conforms to these standards. 17. toukokuuta 12
  • 44. Eclipse IntelliJ IDEA Netbeans Maven Ant Spring Roo ∙∙∙ 17. toukokuuta 12
  • 46. Maven mvn archetype:generate -DarchetypeGroupId=com.vaadin -DarchetypeArtifactId= vaadin-archetype-clean mvn package yourproject-1.0.war 17. toukokuuta 12
  • 47. 17. toukokuuta 12 Vaadin 7 Framework
  • 48. History When What 2001 Millstone Framework is born 2002 Released as Open Source Server-side API compatible 2005 Ajax based rendering 2008 Google Web Toolkit integrated 2009 Renamed to Vaadin 2010 Add-ons 17. toukokuuta 12
  • 49. Heavily under construction [ to be released on Q4 ] 17. toukokuuta 12
  • 51. 17. toukokuuta 12 Empower Developers Embrace Extendability Clean Up
  • 52. Empower Developers View Management Redesign • Remove "browser window" • HttpRequest access • View management API • Simplified Application API by removing unnecessary abstractions • Multitab support by default 17. toukokuuta 12
  • 53. public class Vaadin6testApplication extends Application { public void init() { Window mainWindow = new Window("V6test Application"); setMainWindow(mainWindow); mainWindow.addComponent(new TextField("What is your name")); mainWindow.addComponent(new Button("Do not push me")); } } 17. toukokuuta 12
  • 56. public class V6testApplication extends Application { public void init() { setMainWindow(createWindow()); } public Window getWindow(String name) { Window window = super.getWindow(name); if (window == null) { window = createWindow(); window.setName(name); addWindow(window); } return window; } private Window createWindow() { Window window = new Window("V6test Application"); window.addComponent(new TextField("What is your name")); window.addComponent(new Button("Do not push me")); return window; } } 17. toukokuuta 12
  • 57. public class Vaadin7testRoot extends Root { public void init(WrappedRequest request) { addComponent(new TextField("What is your name")); addComponent(new Button("Do not push me")); } } 17. toukokuuta 12
  • 58. Warning: Naming might be changed from “Root” to “Region” 17. toukokuuta 12
  • 59. public class Vaadin6Application extends Application { public void init() { Window window = new Window("V6test Application"); setMainWindow(window); final Label label = new Label(); final UriFragmentUtility fragment = new UriFragmentUtility(); window.addComponent(fragment); window.addComponent(label); fragment.addListener(new UriFragmentUtility.FragmentChangedListener() { public void fragmentChanged(FragmentChangedEvent source) { label.setValue(fragment.getFragment()); } }); } } 17. toukokuuta 12
  • 60. public class V7testRoot extends Root { public void init(WrappedRequest request) { addComponent(new Label(getFragment())); } } 17. toukokuuta 12
  • 61. public class V7testRoot extends Root { public void init(WrappedRequest request) { final Label label = new Label(getFragment()); addComponent(label); addListener(new FragmentChangedListener() { public void fragmentChanged(FragmentChangedEvent event) { label.setValue(getFragment()); } }); } } 17. toukokuuta 12
  • 62. Most of the changes already available Alpha 1 View management API in Alpha 3 to be released in June 17. toukokuuta 12
  • 63. Empower Developers Full CSS Control • Layout calculations are managed by browser • Improved performance • Support border/margin/... • Drop support for IE6/IE7 • CSS abstraction language • Inject CSS from Java • Per component selectors 17. toukokuuta 12
  • 64. .v-connector { -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; } 17. toukokuuta 12
  • 65. private final ElementResizeListener listener = new ElementResizeListener() { public void onElementResize(ElementResizeEvent e) { int buttonWidth = getLayoutManager().getOuterWidth(e.getElement()); buttonWidth -= getLayoutManager().getMarginRight(e.getElement()); getWidget().adjustButtonSpace(buttonWidth); } }; @Override protected void init() { Element button = getWidget().getWidget(1).getElement(); getLayoutManager().addElementResizeListener(button, listener); } @Override public void onUnregister() { Element button = getWidget().getWidget(1).getElement(); getLayoutManager().removeElementResizeListener(button, listener); } 17. toukokuuta 12
  • 66. Alpha 2 implements lots of layout performance improvements, but work is still unfinished. 17. toukokuuta 12
  • 68. Empower Developers Glue for Integrations • Publish JavaScript API from the server-side • Integrate easily with the rest of the web page • Tag lib to ease integration with JSP/JSF • Centralized shared resource loading (JS/CSS) 17. toukokuuta 12
  • 69. Empower Developers Live Translations • Built in translator API • Custom translation stores • Translated transparently on client-server communication • Switch languages on fly • Strings and resources 17. toukokuuta 12
  • 70. Easier Client-Server Embrace Extendability Empower Developers Communications • Client-server RPC API • Shared state API • Phase out “variables” and “attributes” 17. toukokuuta 12
  • 71. Widget 6 Paintable Variable client Changes server UIDL Component 17. toukokuuta 12
  • 72. Widget 7 Connector client State server RPC Component 17. toukokuuta 12
  • 73. State Bean with most Java types: integers, Strings, lists, maps, ... All server-side changes automatically sent to client. Connectors can access all states of children and parent components 17. toukokuuta 12
  • 74. RPC public interface ButtonRpc extends ServerRpc { public void click(MouseEventDetails details); client to server } example private ButtonRpc rpc = new ButtonRpc() { public void click( private ButtonRpc rpc = MouseEventDetails details) { RpcProxy.create(ButtonRpc.class, this); // do stuff } public void onClick(ClickEvent event) { }; rpc.click( new MouseEventDetails(event)); public Button() { } registerRpc(rpc); } client server 17. toukokuuta 12
  • 75. Already done in Alpha 2, start trying these out today... 17. toukokuuta 12
  • 76. New Extension Embrace Extendability Empower Developers Points • ApplicationServlet plug-ins • “Non-widget” add-ons • Component decorator for extending without extend • Server-push plug-in API • Plug-in for push • State storage plug-ins 17. toukokuuta 12
  • 77. Generic JavaScript Embrace Extendability Empower Developers Widget Wrapper • Convert existing 3rd party widgets to Vaadin • GWT compilation not required 17. toukokuuta 12
  • 78. Ease Common Embrace Extendability Empower Developers Extensions • Allow easy packaging of CSS and images with server-side compositions • Simplify Component Container API to make implementation easier 17. toukokuuta 12
  • 79. Data Binding and Embrace Extendability Empower Developers Clean Up Form redesign • Form binding and layout are cleanly separated • Explicit property convertters • Two phase commit support • Built-in JSR-303 validations • Backwards compatibility helper as add-on 17. toukokuuta 12
  • 81. public class Name { private String firstName; private String lastName; public Name(String firstName, String lastName) { this.firstName = firstName; this.lastName = lastName; } // Setters and getters } 17. toukokuuta 12
  • 82. “Joonas Lehtinen” presentation Component model firstName = “Joonas” lastName = “Lehtinen” 17. toukokuuta 12
  • 83. public class StringToNameConverter implements Converter<String, Name> { public Name convertToModel(String text, Locale locale) throws ConversionException { if (text == null) { return null; } String[] parts = text.split(" "); if (parts.length != 2) { throw new ConversionException("Can not convert text to a name: " + text); } return new Name(parts[0], parts[1]); } public String convertToPresentation(Name name, Locale locale) throws ConversionException { if (name == null) { return null; } else { return name.getFirstName() + " " + name.getLastName(); } } public Class<Name> getModelType() { return Name.class; } public Class<String> getPresentationType() { return String.class; } } 17. toukokuuta 12
  • 84. Name name = new Name("Rudolph", "Reindeer"); final TextField textField = new TextField("Name"); textField.setConverter(new StringToNameConverter()); // .... Name name = (Name) textField.getConvertedValue(); 17. toukokuuta 12
  • 85. public class MyStringToDoubleConverter extends StringToDoubleConverter { @Override protected NumberFormat getFormat(Locale locale) { NumberFormat format = super.getFormat(locale); format.setGroupingUsed(false); format.setMaximumFractionDigits(3); format.setMinimumFractionDigits(3); return format; } } 17. toukokuuta 12
  • 86. public class MyConverterFactory extends DefaultConverterFactory { @Override protected <PRESENTATION, MODEL> Converter<PRESENTATION, MODEL> findConverter( Class<PRESENTATION> presentationType, Class<MODEL> modelType) { // Handle String <-> Double if (presentationType == String.class && modelType == Double.class) { return (Converter<PRESENTATION, MODEL>) new MyStringToDoubleConverter(); } // Let default factory handle the rest return super.findConverter(presentationType, modelType); } } getApplication().setConverterFactory(new MyConverterFactory()); 17. toukokuuta 12
  • 87. table.setConverter(PERCENT_PROPERTY, new StringToNumberConverter() { @Override protected NumberFormat getFormat(Locale locale) { return NumberFormat.getPercentInstance(locale); } }); table.setConverter(CURRENCY_PROPERTY, new StringToNumberConverter() { @Override protected NumberFormat getFormat(Locale locale) { return NumberFormat.getCurrencyInstance(locale); } }); 17. toukokuuta 12
  • 89. public class Person { @Size(min = 5, max = 50) private String name; @Min(0) @Max(100) private int age; // + constructor + setters + getters } 17. toukokuuta 12
  • 90. Person person = new Person("John", 26); BeanItem<Person> item = new BeanItem<Person>(person); TextField firstName = new TextField("First name", item.getItemProperty("name")); firstName.addValidator(new BeanValidator(Person.class, "name")); 17. toukokuuta 12
  • 92. public class Employee { String firstName; String lastName; double salary; Date birthDate; // Getters, setters, … } Form form = new Form(); form.setItemDataSource( new BeanItem<Employee>(employee)); 17. toukokuuta 12
  • 94. Form form = new Form() { @Override protected void attachField(Object propertyId, Field field) { // Some custom logic for placing components } }; 17. toukokuuta 12
  • 95. form.setFormFieldFactory(new FormFieldFactory() { public Field createField(Item item, Object propertyId, Component uiContext) { if ("salary".equals(propertyId)) { TextField tf = new TextField(); tf.setWidth("7em"); return tf; } else if ("birthDate".equals(propertyId)) { DateField df = new DateField(); df.setResolution(DateField.RESOLUTION_DAY); return df; } else { // .. } return DefaultFieldFactory.createFieldByPropertyType(item .getItemProperty(propertyId).getType()); } }); 17. toukokuuta 12
  • 96. FormLayout form = new FormLayout() { TextField firstName = new TextField("First name"); TextField lastName = new TextField("Last name"); TextField salary = new TextField("Salary"); DateField birthDate = new DateField("Birth date"); { birthDate.setResolution(Resolution.DAY); addComponent(firstName); addComponent(lastName); addComponent(birthDate); addComponent(salary); } }; 17. toukokuuta 12
  • 97. final BeanFieldGroup<Employee> fieldGroup = new BeanFieldGroup<Employee>(Employee.class); fieldGroup.bindMemberFields(form); fieldGroup.setItemDataSource(new BeanItem<Employee>(employee)); 17. toukokuuta 12
  • 99. GridLayout form = new GridLayout(2,2) { TextField firstName = new TextField("First name"); TextField lastName = new TextField("Last name"); TextField salary = new TextField("Salary"); DateField birthDate = new DateField("Birth date"); { birthDate.setResolution(Resolution.DAY); setSpacing(true); addComponent(firstName); addComponent(lastName); addComponent(birthDate); addComponent(salary); } }; 17. toukokuuta 12
  • 101. Client-side Embrace Extendability Empower Developers • Review widgetset API • Ease client-side logic Clean Up • Decouple communication from core widgets thoughtout Vaadin 7 series • Client-side compositions • Support GWT Designer • Better support for multiple Vaadin apps per Page 17. toukokuuta 12
  • 102. Improved session Embrace Extendability Empower Developers Clean Up management • Kill all “out-of-sync” errors • Default to one server Window Root per page • Default to keeping sessions live while page is shown 17. toukokuuta 12
  • 103. HTML Embrace Extendability Empower Developers • Simpler DOM as IE6/IE7 is not supported any more Clean Up • WAI-ARIA support • Built in HTML sanitation to improve security 17. toukokuuta 12
  • 104. Old API Embrace Extendability Empower Developers • Replace integer constants with enums Clean Up • Remove the unnecessary Container.Ordered interface • Remove deprecated APIs 17. toukokuuta 12
  • 105. 17. toukokuuta 12 Empower Developers Embrace Extendability Clean Up
  • 106. Changes to roadmap are expected. Almost certainly some things will be postponed to 7.1. 17. toukokuuta 12
  • 107. Vaadin 7.1 • Table redesign • Things postponed from 7.0 17. toukokuuta 12
  • 108. more info 17. toukokuuta 12
  • 109. Find out more at vaadin.com/wiki 17. toukokuuta 12
  • 110. Roots (Windows) • Creating a basic application • Creating multi tab applications • Defining the theme for a Root • Using URI fragments • Finding the current Root and Application • Using URI or parameters or screen size when initializing an application • Generating dynamic resources based on URI or parameters • Creating an application that preserves state on refresh • Creating an application with different features for different clients 17. toukokuuta 12
  • 111. Form & Data binding • Formatting data in Table • Creating a TextField for Integer only input using a data source • Creating a TextField for Integer only input when not using a data source • Creating your own converter for String <-> MyType conversion • Changing the default converters for an application • Creating a master-details view for editing persons • Auto generating a form based on a bean - Vaadin 6 style Form • Creating a form using an existing layout • Using Bean Validation to validate input • Creating a custom field for editing the address of a person 17. toukokuuta 12
  • 112. Custom widgets • Creating a simple component • Using Shared State for communication • Sending events from the client to the server using RPC • Using RPC to send events to the client • Using Components in the shared state • Using Resources in the shared state • Integrating an existing GWT widget • Creating a simple component container • Widget styling using only CSS • Lightweight calculations of widget layout • Complex widget layouts 17. toukokuuta 12
  • 113. Download for Free vaadin.com/book Vaadin is a for build n open source ing mod J look gre ern web ava framework at, applicat your use perform well a ion rs happ nd make s that y. you and http://va adin.com / SBN 978 -9 52-92-67 53-8 90000 9 7 8 95 2 9 267538 $29.95 4th Editio n 674 pages 17. toukokuuta 12
  • 114. brought to you by... #85 Get More Refcardz! Visit refcardz.com CONTENTS INCLUDE: About Vaadin Getting Started with Vaadin Creating An Application Components Layout Components Themes Data Binding and more... By Marko Grönroos ABOUT VAADIN Web Browser External Client-Side Resources Vaadin is a server-side Ajax web application development Engine framework that allows you to build web applications just like AJAX Requests with traditional desktop frameworks, such as AWT or Swing. An Servlet Container Java File application is built from user interface components contained Servlet Resources hierarchically in layout components. Data In the server-driven model, the application code runs on Application UI Binding Default Class Component Theme a server, while the actual user interaction is handled by a client-side engine running in the browser. The client-server Inherits Events Changes Inherits communications and any client-side technologies, such as User Event Data Application Application HTML and JavaScript, are invisible to the developer. As the Application Listener Model Themes Resources client-side engine runs as JavaScript in the browser, there is no need to install plug-ins. Vaadin is released under the Apache Database License 2.0. Web Java Vaadin Your Web Figure 2: Architecture for Vaadin Applications Browser Web UI Java Service Client-Side Server Components Application You can get a reference to the application object w.dzone.com Engine EJB Hot Tip from any component attached to the application with DB Event Listeners Figure 1: Vaadin Client-Server Architecture In the event-driven model, user interaction with user interface If the built-in selection of components is not enough, you can components triggers server-side events, which you can handle 17. toukokuuta 12 develop new components with the Google Web Toolkit (GWT)
  • 115. Expert services Better Online support Results Training Faster Tools vaadin.com/pro Questions? joonas@vaadin.com vaadin.com/joonas 12-5-17 @joonaslehtinen 17. toukokuuta 12