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-advanced.asciidoc 2.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. ---
  2. title: Advanced Client-Side Topics
  3. order: 10
  4. layout: page
  5. ---
  6. [[gwt.advanced]]
  7. = Advanced Client-Side Topics
  8. In the following, we mention some topics that you may encounter when integrating
  9. widgets.
  10. [[gwt.advanced.phases]]
  11. == Client-Side Processing Phases
  12. Vaadin's client-side engine reacts to changes from the server in a number of
  13. phases, the order of which can be relevant for a connector. The processing
  14. occurs in the [methodname]#handleUIDLMessage()# method in
  15. [classname]#ApplicationConnection#, but the logic can be quite overwhelming, so
  16. we describe the phases in the following summary.
  17. . Any dependencies defined by using [classname]#@JavaScript#,
  18. [classname]#@StyleSheet# or [classname]#@HtmlImport# on the server-side class
  19. are loaded. Processing does not continue until the browser confirms that they
  20. have been loaded.
  21. . New connectors are instantiated and [methodname]#init()# is run for each
  22. [interfacename]#Connector#.
  23. . State objects are updated, but no state change event is fired yet.
  24. . The connector hierarchy is updated, but no hierarchy change event is fired yet.
  25. [methodname]#setParent()# and [methodname]#setChildren()# are run in this phase.
  26. . Hierarchy change events are fired. This means that all state objects and the
  27. entire hierarchy are already up to date when this happens. The DOM hierarchy
  28. should in theory be up to date after all hierarchy events have been handled,
  29. although there are some built-in components that for various reasons do not
  30. always live up to this promise.
  31. . Captions are updated, causing [methodname]#updateCaption()# to be invoked on
  32. layouts as needed.
  33. . [classname]#@DelegateToWidget# is handled for all changed state objects using
  34. the annotation.
  35. . State change events are fired for all changed state objects.
  36. . [methodname]#updateFromUIDL()# is called for legacy connectors.
  37. . All RPC methods received from the server are invoked.
  38. . Connectors that are no longer included in the hierarchy are unregistered. This
  39. calls [methodname]#onUnregister()# on the [interfacename]#Connector#.
  40. . The layout phase starts, first checking the sizes and positions of all elements,
  41. and then notifying any [interfacename]#ElementResizeListener#s, as well as
  42. calling the appropriate layout method for the connectors that implement either
  43. [classname]#SimpleManagedLayout# or [classname]#DirectionalManagedLayout#
  44. interface.