Gwt - why are there two types of "Element"?

Why does GWT have two types of elements? you have com.google.gwt.dom.client.Element and com.google.gwt.user.client.Element - when you use one above the other and whether they are compatible as I get the following exception.

 Caused by: com.google.gwt.core.client.JavaScriptException: (TypeError): Object [object DOMWindow] has no method 'setAttribute' 

Thanks..

Yang ..

+4
source share
1 answer

If you look in the sources, you will see that com.google.gwt.user.client.Element extends com.google.gwt.dom.client.Element. com.google.gwt.user.client.Element is actually an inherited class from GWT 1.4. Since the 2.0 GWT team decided to do some refactoring, but they need backward compatibility, so you basically have the same class in two packages.

these two objects have nothing to do with your error. Most likely you selected the Window object in Element, so you get this error.

+4
source

Source: https://habr.com/ru/post/1393248/


All Articles