javacro'15 - gwt integration with vaadin - peter lehto
Upload: hujak-hrvatska-udruga-java-korisnika-croatian-java-user-association
Post on 21-Jul-2015
345 views
TRANSCRIPT
![Page 1: JavaCro'15 - GWT integration with Vaadin - Peter Lehto](https://reader034.vdocuments.us/reader034/viewer/2022042716/55ae60581a28ab50798b4573/html5/thumbnails/1.jpg)
GWT integration with Vaadin
Peter Lehto @peter_lehto
expert & trainer
![Page 2: JavaCro'15 - GWT integration with Vaadin - Peter Lehto](https://reader034.vdocuments.us/reader034/viewer/2022042716/55ae60581a28ab50798b4573/html5/thumbnails/2.jpg)
Vaadin &
GWT
GWT Transport
mechanisms
![Page 3: JavaCro'15 - GWT integration with Vaadin - Peter Lehto](https://reader034.vdocuments.us/reader034/viewer/2022042716/55ae60581a28ab50798b4573/html5/thumbnails/3.jpg)
QA
Vaadin
Connectors
Web components
with Polymer
![Page 4: JavaCro'15 - GWT integration with Vaadin - Peter Lehto](https://reader034.vdocuments.us/reader034/viewer/2022042716/55ae60581a28ab50798b4573/html5/thumbnails/4.jpg)
Vaadin &
GWT
![Page 5: JavaCro'15 - GWT integration with Vaadin - Peter Lehto](https://reader034.vdocuments.us/reader034/viewer/2022042716/55ae60581a28ab50798b4573/html5/thumbnails/5.jpg)
![Page 6: JavaCro'15 - GWT integration with Vaadin - Peter Lehto](https://reader034.vdocuments.us/reader034/viewer/2022042716/55ae60581a28ab50798b4573/html5/thumbnails/6.jpg)
Server driven UI framework with GWT
based thin client
![Page 7: JavaCro'15 - GWT integration with Vaadin - Peter Lehto](https://reader034.vdocuments.us/reader034/viewer/2022042716/55ae60581a28ab50798b4573/html5/thumbnails/7.jpg)
UI
Browser
![Page 8: JavaCro'15 - GWT integration with Vaadin - Peter Lehto](https://reader034.vdocuments.us/reader034/viewer/2022042716/55ae60581a28ab50798b4573/html5/thumbnails/8.jpg)
UI
Browser
Widgets
![Page 9: JavaCro'15 - GWT integration with Vaadin - Peter Lehto](https://reader034.vdocuments.us/reader034/viewer/2022042716/55ae60581a28ab50798b4573/html5/thumbnails/9.jpg)
Them
e UI
Browser
Widgets
![Page 10: JavaCro'15 - GWT integration with Vaadin - Peter Lehto](https://reader034.vdocuments.us/reader034/viewer/2022042716/55ae60581a28ab50798b4573/html5/thumbnails/10.jpg)
Them
e UI
Browser
Backend
Server
Widgets
![Page 11: JavaCro'15 - GWT integration with Vaadin - Peter Lehto](https://reader034.vdocuments.us/reader034/viewer/2022042716/55ae60581a28ab50798b4573/html5/thumbnails/11.jpg)
Them
e UI
Browser
Backend
Server
Widgets
Service (GWT-RPC)
![Page 12: JavaCro'15 - GWT integration with Vaadin - Peter Lehto](https://reader034.vdocuments.us/reader034/viewer/2022042716/55ae60581a28ab50798b4573/html5/thumbnails/12.jpg)
Backend
Server
![Page 13: JavaCro'15 - GWT integration with Vaadin - Peter Lehto](https://reader034.vdocuments.us/reader034/viewer/2022042716/55ae60581a28ab50798b4573/html5/thumbnails/13.jpg)
UI Backend
Server
![Page 14: JavaCro'15 - GWT integration with Vaadin - Peter Lehto](https://reader034.vdocuments.us/reader034/viewer/2022042716/55ae60581a28ab50798b4573/html5/thumbnails/14.jpg)
Browser
UI Backend
Server
Widgets Components
![Page 15: JavaCro'15 - GWT integration with Vaadin - Peter Lehto](https://reader034.vdocuments.us/reader034/viewer/2022042716/55ae60581a28ab50798b4573/html5/thumbnails/15.jpg)
Them
e
Browser
UI Backend
Server
Widgets Components
![Page 16: JavaCro'15 - GWT integration with Vaadin - Peter Lehto](https://reader034.vdocuments.us/reader034/viewer/2022042716/55ae60581a28ab50798b4573/html5/thumbnails/16.jpg)
Them
e
Browser
UI Backend
Server
Widgets Components
![Page 17: JavaCro'15 - GWT integration with Vaadin - Peter Lehto](https://reader034.vdocuments.us/reader034/viewer/2022042716/55ae60581a28ab50798b4573/html5/thumbnails/17.jpg)
User Interface Components
![Page 18: JavaCro'15 - GWT integration with Vaadin - Peter Lehto](https://reader034.vdocuments.us/reader034/viewer/2022042716/55ae60581a28ab50798b4573/html5/thumbnails/18.jpg)
Developer
Productivity
Rich
UX
![Page 19: JavaCro'15 - GWT integration with Vaadin - Peter Lehto](https://reader034.vdocuments.us/reader034/viewer/2022042716/55ae60581a28ab50798b4573/html5/thumbnails/19.jpg)
Vaadin += GWT
![Page 20: JavaCro'15 - GWT integration with Vaadin - Peter Lehto](https://reader034.vdocuments.us/reader034/viewer/2022042716/55ae60581a28ab50798b4573/html5/thumbnails/20.jpg)
![Page 21: JavaCro'15 - GWT integration with Vaadin - Peter Lehto](https://reader034.vdocuments.us/reader034/viewer/2022042716/55ae60581a28ab50798b4573/html5/thumbnails/21.jpg)
![Page 22: JavaCro'15 - GWT integration with Vaadin - Peter Lehto](https://reader034.vdocuments.us/reader034/viewer/2022042716/55ae60581a28ab50798b4573/html5/thumbnails/22.jpg)
GWT Transport
mechanisms
![Page 23: JavaCro'15 - GWT integration with Vaadin - Peter Lehto](https://reader034.vdocuments.us/reader034/viewer/2022042716/55ae60581a28ab50798b4573/html5/thumbnails/23.jpg)
RequestBuilder RequestBuilder builder = new RequestBuilder(RequestBuilder.GET, url);try { builder.sendRequest(requestDataString, new RequestCallback() { @Override
public void onResponseReceived(Request request, Response response) { int statusCode = response.getStatusCode(); String text = response.getText();
} @Override
public void onError(Request request, Throwable exception) { // TODO Handle asynchronous problems
} }); } catch (RequestException e) { // TODO Handle synchronous problems}
![Page 24: JavaCro'15 - GWT integration with Vaadin - Peter Lehto](https://reader034.vdocuments.us/reader034/viewer/2022042716/55ae60581a28ab50798b4573/html5/thumbnails/24.jpg)
RequestBuilder
Good
• It just works
![Page 25: JavaCro'15 - GWT integration with Vaadin - Peter Lehto](https://reader034.vdocuments.us/reader034/viewer/2022042716/55ae60581a28ab50798b4573/html5/thumbnails/25.jpg)
RequestBuilder
Good
• It just works
Bad
• Very low level
![Page 26: JavaCro'15 - GWT integration with Vaadin - Peter Lehto](https://reader034.vdocuments.us/reader034/viewer/2022042716/55ae60581a28ab50798b4573/html5/thumbnails/26.jpg)
What to send?
![Page 27: JavaCro'15 - GWT integration with Vaadin - Peter Lehto](https://reader034.vdocuments.us/reader034/viewer/2022042716/55ae60581a28ab50798b4573/html5/thumbnails/27.jpg)
Contact public class Contact { private String name; private int yearOfBirth;
private List<String> emailAddresses; private Address address;
public static class Address { private String street; private String city; } // + Getters and setters}
![Page 28: JavaCro'15 - GWT integration with Vaadin - Peter Lehto](https://reader034.vdocuments.us/reader034/viewer/2022042716/55ae60581a28ab50798b4573/html5/thumbnails/28.jpg)
String conversion
String data = contact.getName();data += "," + contact.getYearOfBirth();String[] parts = data.split(",");contact.setName(parts[0]);contact.setYearOfBirth(Integer.parseInt(parts[1]));
![Page 29: JavaCro'15 - GWT integration with Vaadin - Peter Lehto](https://reader034.vdocuments.us/reader034/viewer/2022042716/55ae60581a28ab50798b4573/html5/thumbnails/29.jpg)
String conversion
String data = contact.getName();data += "," + contact.getYearOfBirth();String[] parts = data.split(",");contact.setName(parts[0]);contact.setYearOfBirth(Integer.parseInt(parts[1]));
![Page 30: JavaCro'15 - GWT integration with Vaadin - Peter Lehto](https://reader034.vdocuments.us/reader034/viewer/2022042716/55ae60581a28ab50798b4573/html5/thumbnails/30.jpg)
JSON { name: "John Doe", yearOfBirth: 1900, address: { street: "Happy Street 1", city: "Turku" }, emailAddresses: ["[email protected]", "[email protected]"]}
![Page 31: JavaCro'15 - GWT integration with Vaadin - Peter Lehto](https://reader034.vdocuments.us/reader034/viewer/2022042716/55ae60581a28ab50798b4573/html5/thumbnails/31.jpg)
JSONValue parsing JSONObject json = JSONParser.parseStrict(string).isObject();contact.setName(json.get("name").isString().stringValue());contact.setYearOfBirth( (int) json.get("yearOfBirth").isNumber().doubleValue());contact.setAddress( parseAddress(json.get("address").isObject()));
JSONArray emailAddresses = json.get("emailAddresses").isArray(); for (int i = 0; i < emailAddresses.size(); i++) { contact.getEmailAddresses().add(
} }
![Page 32: JavaCro'15 - GWT integration with Vaadin - Peter Lehto](https://reader034.vdocuments.us/reader034/viewer/2022042716/55ae60581a28ab50798b4573/html5/thumbnails/32.jpg)
JSONValue
Good
• It’s standard • Human readable • Compact format
![Page 33: JavaCro'15 - GWT integration with Vaadin - Peter Lehto](https://reader034.vdocuments.us/reader034/viewer/2022042716/55ae60581a28ab50798b4573/html5/thumbnails/33.jpg)
JSONValue
Good
• It’s standard • Human readable • Compact format
Bad
• Not completely typesafe
• Boilerplate • Client only
![Page 34: JavaCro'15 - GWT integration with Vaadin - Peter Lehto](https://reader034.vdocuments.us/reader034/viewer/2022042716/55ae60581a28ab50798b4573/html5/thumbnails/34.jpg)
What about the server?
![Page 35: JavaCro'15 - GWT integration with Vaadin - Peter Lehto](https://reader034.vdocuments.us/reader034/viewer/2022042716/55ae60581a28ab50798b4573/html5/thumbnails/35.jpg)
Jackson on the server ObjectMapper mapper = new ObjectMapper();try { Contact contact = mapper.readValue(string, Contact.class);} catch (VariousExceptions e) { // Do something sensible}
![Page 36: JavaCro'15 - GWT integration with Vaadin - Peter Lehto](https://reader034.vdocuments.us/reader034/viewer/2022042716/55ae60581a28ab50798b4573/html5/thumbnails/36.jpg)
Jackson and GWT? - gwt-jackson
![Page 37: JavaCro'15 - GWT integration with Vaadin - Peter Lehto](https://reader034.vdocuments.us/reader034/viewer/2022042716/55ae60581a28ab50798b4573/html5/thumbnails/37.jpg)
gwt-jackson public static interface ContactMapper extends ObjectMapper<Contact> {}
public Contact parseContact(String jsonString) { ContactMapper mapper = GWT.create(ContactMapper.class); Contact contact = mapper.read(jsonString); return contact;}
![Page 38: JavaCro'15 - GWT integration with Vaadin - Peter Lehto](https://reader034.vdocuments.us/reader034/viewer/2022042716/55ae60581a28ab50798b4573/html5/thumbnails/38.jpg)
Jackson
Good
• Minimal boiler plate
• Can share codebetween serverand client
Bad
• Only creatingand readingStrings
![Page 39: JavaCro'15 - GWT integration with Vaadin - Peter Lehto](https://reader034.vdocuments.us/reader034/viewer/2022042716/55ae60581a28ab50798b4573/html5/thumbnails/39.jpg)
Where to send?
![Page 40: JavaCro'15 - GWT integration with Vaadin - Peter Lehto](https://reader034.vdocuments.us/reader034/viewer/2022042716/55ae60581a28ab50798b4573/html5/thumbnails/40.jpg)
Remote procedure call public interface ContactService extends RemoteService { public void saveContact(Contact contact); public List<Contact> getContacts();}
public interface ContactServiceAsync { public void saveContact(Contact contact, AsyncCallback<Void> callback); public void getContacts(AsyncCallback<List<Contact>>
}
![Page 41: JavaCro'15 - GWT integration with Vaadin - Peter Lehto](https://reader034.vdocuments.us/reader034/viewer/2022042716/55ae60581a28ab50798b4573/html5/thumbnails/41.jpg)
GWT-RCP
Good
• Simple butpowerful concept
• Default solution • Optimized
Bad
• Sending largeobject graph
• Polymorphismproblems
![Page 42: JavaCro'15 - GWT integration with Vaadin - Peter Lehto](https://reader034.vdocuments.us/reader034/viewer/2022042716/55ae60581a28ab50798b4573/html5/thumbnails/42.jpg)
Prefer JSON + REST?- me too :)
![Page 43: JavaCro'15 - GWT integration with Vaadin - Peter Lehto](https://reader034.vdocuments.us/reader034/viewer/2022042716/55ae60581a28ab50798b4573/html5/thumbnails/43.jpg)
REST GET /contacts
DELETE /contacts/5
PUT /contacts { name: “John Doe”, ... }
![Page 44: JavaCro'15 - GWT integration with Vaadin - Peter Lehto](https://reader034.vdocuments.us/reader034/viewer/2022042716/55ae60581a28ab50798b4573/html5/thumbnails/44.jpg)
JAX-RS @Path("/contacts")public interface ContactsService { @GET public List<Contact> listContacts();
@Path("/{id}") @DELETE public void deleteContact(@PathParam("id") int id);
@PUT public void createContact(Contact contact);}
![Page 45: JavaCro'15 - GWT integration with Vaadin - Peter Lehto](https://reader034.vdocuments.us/reader034/viewer/2022042716/55ae60581a28ab50798b4573/html5/thumbnails/45.jpg)
Vaadin Connectors
![Page 46: JavaCro'15 - GWT integration with Vaadin - Peter Lehto](https://reader034.vdocuments.us/reader034/viewer/2022042716/55ae60581a28ab50798b4573/html5/thumbnails/46.jpg)
So how about Vaadin?- Put server in charge!
![Page 47: JavaCro'15 - GWT integration with Vaadin - Peter Lehto](https://reader034.vdocuments.us/reader034/viewer/2022042716/55ae60581a28ab50798b4573/html5/thumbnails/47.jpg)
![Page 48: JavaCro'15 - GWT integration with Vaadin - Peter Lehto](https://reader034.vdocuments.us/reader034/viewer/2022042716/55ae60581a28ab50798b4573/html5/thumbnails/48.jpg)
State synchronization public class ContactState extends SharedState { public String name; @DelegateToWidget public int yearOfBirth;}
@OnStateChange("name")private void updateName() { doSomethingWithTheName(getState().name);}
![Page 49: JavaCro'15 - GWT integration with Vaadin - Peter Lehto](https://reader034.vdocuments.us/reader034/viewer/2022042716/55ae60581a28ab50798b4573/html5/thumbnails/49.jpg)
RPC public interface ContactRpc extends ServerRpc { public void deleteContact(int id);} // Register RPC handler on the serverregisterRpc(new ContactRpc() { @Override public void deleteContact(int id) { ContactDAO.deleteById(id);} }); // Send RPC from the clientpublic void sendDelete(int contactId) { getRpcProxy(ContactRpc.class).deleteContact(contactId);}
![Page 50: JavaCro'15 - GWT integration with Vaadin - Peter Lehto](https://reader034.vdocuments.us/reader034/viewer/2022042716/55ae60581a28ab50798b4573/html5/thumbnails/50.jpg)
Server
Button
![Page 51: JavaCro'15 - GWT integration with Vaadin - Peter Lehto](https://reader034.vdocuments.us/reader034/viewer/2022042716/55ae60581a28ab50798b4573/html5/thumbnails/51.jpg)
Browser
Server
VButton
Button
![Page 52: JavaCro'15 - GWT integration with Vaadin - Peter Lehto](https://reader034.vdocuments.us/reader034/viewer/2022042716/55ae60581a28ab50798b4573/html5/thumbnails/52.jpg)
Browser
Server
VButton
ButtonConnector
Button
![Page 53: JavaCro'15 - GWT integration with Vaadin - Peter Lehto](https://reader034.vdocuments.us/reader034/viewer/2022042716/55ae60581a28ab50798b4573/html5/thumbnails/53.jpg)
Browser
Server
VButton
ButtonConnector
SharedState
Button
SharedState
![Page 54: JavaCro'15 - GWT integration with Vaadin - Peter Lehto](https://reader034.vdocuments.us/reader034/viewer/2022042716/55ae60581a28ab50798b4573/html5/thumbnails/54.jpg)
Browser
Server
SharedState
SharedState
Button
VButton
ButtonConnector
![Page 55: JavaCro'15 - GWT integration with Vaadin - Peter Lehto](https://reader034.vdocuments.us/reader034/viewer/2022042716/55ae60581a28ab50798b4573/html5/thumbnails/55.jpg)
Browser
Server
SharedState
SharedState
RPC
RPC
Button
VButton
ButtonConnector
![Page 56: JavaCro'15 - GWT integration with Vaadin - Peter Lehto](https://reader034.vdocuments.us/reader034/viewer/2022042716/55ae60581a28ab50798b4573/html5/thumbnails/56.jpg)
Browser
Server
SharedState
SharedState
RPC
RPC
Button
VButton
ButtonConnector
![Page 57: JavaCro'15 - GWT integration with Vaadin - Peter Lehto](https://reader034.vdocuments.us/reader034/viewer/2022042716/55ae60581a28ab50798b4573/html5/thumbnails/57.jpg)
Browser
Server
SharedState
SharedState
RPC
RPC
Button
VButton
ButtonConnector
![Page 58: JavaCro'15 - GWT integration with Vaadin - Peter Lehto](https://reader034.vdocuments.us/reader034/viewer/2022042716/55ae60581a28ab50798b4573/html5/thumbnails/58.jpg)
Browser
Server
Button
VButton
ButtonConnector
SharedState
SharedState
RPC
RPC
![Page 59: JavaCro'15 - GWT integration with Vaadin - Peter Lehto](https://reader034.vdocuments.us/reader034/viewer/2022042716/55ae60581a28ab50798b4573/html5/thumbnails/59.jpg)
server
client
Component
Widget
Connector
RPC
State
![Page 60: JavaCro'15 - GWT integration with Vaadin - Peter Lehto](https://reader034.vdocuments.us/reader034/viewer/2022042716/55ae60581a28ab50798b4573/html5/thumbnails/60.jpg)
ButtonConnector @Connect(Button.class)public class ButtonConnector extends AbstractComponentConnector implements ClickHandler, FocusHandler {
public void init() { getWidget().addClickHandler(this); }
@OnStateChange({ "caption", "captionAsHtml" }) void setCaption() { getWidget().setCaptionText(getState()); }
![Page 61: JavaCro'15 - GWT integration with Vaadin - Peter Lehto](https://reader034.vdocuments.us/reader034/viewer/2022042716/55ae60581a28ab50798b4573/html5/thumbnails/61.jpg)
public void onClick(ClickEvent event) { getRpcProxy(ButtonServerRpc.class). click(buildDetails(event)); } }
![Page 62: JavaCro'15 - GWT integration with Vaadin - Peter Lehto](https://reader034.vdocuments.us/reader034/viewer/2022042716/55ae60581a28ab50798b4573/html5/thumbnails/62.jpg)
ButtonState public class ButtonState extends AbstractComponentState { …
public String caption;public boolean disableOnClick;public int tabIndex;…
}
![Page 63: JavaCro'15 - GWT integration with Vaadin - Peter Lehto](https://reader034.vdocuments.us/reader034/viewer/2022042716/55ae60581a28ab50798b4573/html5/thumbnails/63.jpg)
ButtonServerRPC public interface ButtonServerRpc extends ServerRpc {
public void click(MouseEventDetails mouseEventDetails);
}
![Page 64: JavaCro'15 - GWT integration with Vaadin - Peter Lehto](https://reader034.vdocuments.us/reader034/viewer/2022042716/55ae60581a28ab50798b4573/html5/thumbnails/64.jpg)
Server RPC implementation public class Button extends AbstractComponent { … private ButtonServerRpc rpc = new ButtonServerRpc() { public void click(MouseEventDetails details) { fireClick(details); } … }
![Page 65: JavaCro'15 - GWT integration with Vaadin - Peter Lehto](https://reader034.vdocuments.us/reader034/viewer/2022042716/55ae60581a28ab50798b4573/html5/thumbnails/65.jpg)
Vaadin Connectors
Good
• Stateful server • Websocket
support • Integrated
JSON
Bad
• Stateful server • Tied to
framework
![Page 66: JavaCro'15 - GWT integration with Vaadin - Peter Lehto](https://reader034.vdocuments.us/reader034/viewer/2022042716/55ae60581a28ab50798b4573/html5/thumbnails/66.jpg)
Web components
with Polymer
![Page 67: JavaCro'15 - GWT integration with Vaadin - Peter Lehto](https://reader034.vdocuments.us/reader034/viewer/2022042716/55ae60581a28ab50798b4573/html5/thumbnails/67.jpg)
Reuseable HTML components!
![Page 68: JavaCro'15 - GWT integration with Vaadin - Peter Lehto](https://reader034.vdocuments.us/reader034/viewer/2022042716/55ae60581a28ab50798b4573/html5/thumbnails/68.jpg)
Problem: Unique DOM tree
![Page 69: JavaCro'15 - GWT integration with Vaadin - Peter Lehto](https://reader034.vdocuments.us/reader034/viewer/2022042716/55ae60581a28ab50798b4573/html5/thumbnails/69.jpg)
Solution: Shadow DOM
![Page 70: JavaCro'15 - GWT integration with Vaadin - Peter Lehto](https://reader034.vdocuments.us/reader034/viewer/2022042716/55ae60581a28ab50798b4573/html5/thumbnails/70.jpg)
Encapsulation
![Page 71: JavaCro'15 - GWT integration with Vaadin - Peter Lehto](https://reader034.vdocuments.us/reader034/viewer/2022042716/55ae60581a28ab50798b4573/html5/thumbnails/71.jpg)
What shadow DOM looks like?
![Page 73: JavaCro'15 - GWT integration with Vaadin - Peter Lehto](https://reader034.vdocuments.us/reader034/viewer/2022042716/55ae60581a28ab50798b4573/html5/thumbnails/73.jpg)
<v-grid>
![Page 74: JavaCro'15 - GWT integration with Vaadin - Peter Lehto](https://reader034.vdocuments.us/reader034/viewer/2022042716/55ae60581a28ab50798b4573/html5/thumbnails/74.jpg)
Vaadin Grid Client Widget
Expose JavaScript API via
JsInterop from GWT 2.8
Use Shadow DOM and HTML
imports from Polymer
![Page 75: JavaCro'15 - GWT integration with Vaadin - Peter Lehto](https://reader034.vdocuments.us/reader034/viewer/2022042716/55ae60581a28ab50798b4573/html5/thumbnails/75.jpg)
@JsNamespace(JS.VAADIN_JS_NAMESPACE) @JsExport @JsType public class GridComponent… … private final Grid grid; // Grid widget
public JSColumn addColumn(JSColumn jsColumn, Object beforeColumnId) { grid.addColumn } …
![Page 76: JavaCro'15 - GWT integration with Vaadin - Peter Lehto](https://reader034.vdocuments.us/reader034/viewer/2022042716/55ae60581a28ab50798b4573/html5/thumbnails/76.jpg)
@JsType public interface JSColumn {
@JsProperty String getName();
@JsProperty void setName(String s);
![Page 77: JavaCro'15 - GWT integration with Vaadin - Peter Lehto](https://reader034.vdocuments.us/reader034/viewer/2022042716/55ae60581a28ab50798b4573/html5/thumbnails/77.jpg)
<link rel='import' href='vaadin-grid-import.html'> <link rel='import' href='../bower_components/polymer/polymer.html'> <link rel="stylesheet" href="vaadin-grid.css" shim-shadowdom>
<dom-module id="v-grid"> <template> </template> </dom-module>
<script> var prototype = { is: “v-grid", properties: { … }, created: function() {
this._grid = new vaadin.GridComponent(); }, attached: function() {
this._grid.attached(this, Polymer.dom(this).querySelector(“table”), Polymer.dom(this.root));
},
… } </script>
![Page 78: JavaCro'15 - GWT integration with Vaadin - Peter Lehto](https://reader034.vdocuments.us/reader034/viewer/2022042716/55ae60581a28ab50798b4573/html5/thumbnails/78.jpg)
GridWidget (js)
GridComponent (js)
polymer.html
webcomponents.jsdemo.html vaadin-grid.html
![Page 79: JavaCro'15 - GWT integration with Vaadin - Peter Lehto](https://reader034.vdocuments.us/reader034/viewer/2022042716/55ae60581a28ab50798b4573/html5/thumbnails/79.jpg)
Lessons learned today
1. There are several ways of communicating between GWT client and server
2. Vaadin Connectors use custom hybrid of JSON and RequestBuilder wrapped to higher level SharedState and RPC
3. gwt-jackson with REST is very interesting option
4. Polymer allows browsers to support features needed forfor web components
![Page 80: JavaCro'15 - GWT integration with Vaadin - Peter Lehto](https://reader034.vdocuments.us/reader034/viewer/2022042716/55ae60581a28ab50798b4573/html5/thumbnails/80.jpg)
Thank you!Peter Lehto @peter_lehto
expert & trainer