You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

gwt-vaadin-6-migration.asciidoc 2.1KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. ---
  2. title: Migrating from Vaadin 6
  3. order: 12
  4. layout: page
  5. ---
  6. [[gwt.vaadin-6-migration]]
  7. = Migrating from Vaadin 6
  8. ((("Vaadin 6 Migration", "add-ons", id="term.gwt.vaadin-6-migration", range="startofrange")))
  9. The client-side architecture was redesigned almost entirely in Vaadin 7. In
  10. Vaadin 6, state synchronization was done explicitly by serializing and
  11. deserializing the state on the server- and client-side. In Vaadin 7, the
  12. serialization is handled automatically by the framework using state objects.
  13. In Vaadin 6, a server-side component serialized its state to the client-side
  14. using the [interfacename]#Paintable# interface in the client-side and
  15. deserialized the state through the [interfacename]#VariableOwner# interface. In
  16. Vaadin 7, these are done through the [interfacename]#ClientConnector# interface.
  17. On the client-side, a widget deserialized its state through the
  18. [interfacename]#Paintable# interface and sent state changes through the
  19. [interfacename]#ApplicationConnection# object. In Vaadin 7, these are replaced
  20. with the [interfacename]#ServerConnector#.
  21. In addition to state synchronization, Vaadin 7 has an RPC mechanism that can be
  22. used for communicating events. They are especially useful for events that are
  23. not associated with a state change, such as a button click.
  24. The framework ensures that the connector hierarchy and states are up-to-date
  25. when listeners are called.
  26. [[gwt.vaadin-6-migration.quick]]
  27. == Quick (and Dirty) Migration
  28. Vaadin 7 has a compatibility layer that allows quick conversion of a widget.
  29. . Create a connector class, such as [classname]#MyConnector#, that extends
  30. [classname]#LegacyConnector#. Implement the [methodname]#getWidget()# method.
  31. . Move the [literal]#++@ClientWidget(MyWidget.class)++# from the server-side
  32. component, say [classname]#MyComponent#, to the [classname]#MyConnector# class
  33. and make it [literal]#++@Connect(MyComponent.class)++#.
  34. . Have the server-side component implement the LegacyComponent interface to enable
  35. compatibility handling.
  36. . Remove any calls to [literal]#++super.paintContent()++#
  37. . Update any imports on the client-side
  38. (((range="endofrange", startref="term.gwt.vaadin-6-migration")))