Reputation: 398
I would like to integrate ganttchart GWT widget with vaadin7 application available at https://code.google.com/p/gwtgantt/
I went through some links which explores about integrating GWT widgets with vaadin7 but I don't think I understood.
Also, Do I need to write the connector and other stuff in vaadin to integrate GWT widgets? If yes then I am not quite sure what I will be writing in that.
Does anyone tried the same GWT widget with vaadin7 before?
Any pointers or Sample code will be really appreciated.
Regards,
Azhar
Upvotes: 1
Views: 2300
Reputation: 63
When you are able to use Vaadin 7, this wiki article should help you to get started: https://vaadin.com/wiki/-/wiki/Main/Integrating%20an%20existing%20GWT%20widget
I believe it handles exactly what you are asking for.
Upvotes: 1
Reputation: 6115
Basically, you need to write the server side code for GWT widgets, and extends the GWT widgets with the communication capability. Here a good project for you to get start with https://github.com/360-Innovations/VaadinSmartGWT
A little example (for Vaadin 6):
1 use eclipse with Vaadin plugin installed to create a Vaadin project then create Vaadin widget unpon that project, Vaadin plugin will generate all the nuts and bolts.
2 write the code
a client class wrapper for GanttChart It implements Paintable interface to communicate with server side
public class VGanttChart extends GanttChart implements Paintable {
public void paint(PaintTarget target) throws PaintException {
}
public void requestRepaint() {
}
... ...
}
for use of each methods, please look at the source comments at Paintable.class
a server side corresponding class:
@ClientWidget(value = VGanttChart.class, loadStyle = LoadStyle.EAGER)
public class GanttChart extends AbstractComponent {
public void paintContent(PaintTarget target) throws PaintException {
}
public void changeVariables(Object source, Map<String, Object> variables) {
}
... ...
}
3 exporting as Vaadin Add-on Package, this is also provided by Vaadin plugin.
4 add the exported jar to your project /WEB-INF/lib, edit your XXXWidgetset.gwt.xml file by adding your add-on's widgetset like this:
if your widgetset def file is
<inherits name="package path to your add-on's widgetset def file"/>
myWidgetset.gwt.xml
, then the value for attribute name should be "package path to widgetset"/myWidgetset
5 Compile your Widgetset, this is also provided by Vaadin eclipse plugin, after compilation, new set of javascript, css, image resource was generated, now you can use your add-ons via the server side class.
Upvotes: 0