3

I have a big project using other UI which has a big portion of it using the GWT canvas and if I am thinking to use the domino-ui I prefer to keep the GWT canvas code.

Ahmad Bawaneh
  • 1,014
  • 8
  • 23

1 Answers1

2

Yes you can. Either you use elemental2 canvas, Or you use GWT canvas and wrap it as an element. you need to include this dependency

<dependency>
    <groupId>org.jboss.gwt.elemento</groupId>
    <artifactId>elemento-widget</artifactId>
    <version>${use elemento version here}</version>
</dependency>

Then you can wrap a canvas as element using this

Widgets.asElement(myGwtCanvas)

And don't forget about the inheritance of this GWT module

Ahmad Bawaneh
  • 1,014
  • 8
  • 23
  • Do you have any more information about this Widgets.asElement ? Can I wrap any custom Widget I created using this technique ? And all listeners keep working ? We have a large project with very big custom Widgets... So if we can gradually move to a full GWT3/J2CL compatible system this way that would be very handy. – Knarf Nov 29 '18 at 13:35
  • You can find this in elemento repo [https://github.com/hal/elemento] this can be used to only wrap widget/elements vise versa, but this, listeners on elements will keep working but the result will not be a full widget, for example this will not set the widget parent. and the purpose for this is exactly to ease the migration from widgets to elements. – Ahmad Bawaneh Dec 01 '18 at 21:20