admin管理员组

文章数量:1332352

I'm trying to get a div element with ID="calendarJS" and pass it to a constructor.

import elemental2.dom.Document;
import elemental2.dom.Element;
.
.
.
Element calendarEl = new Document().getElementById("calendarJS");

After loading the page the GWT compiler shows this error:

.
.
.
[ERROR] Line 133: No source code is available for type elemental2.dom.Element; did you fet to inherit a required module?
[ERROR] Line 133: No source code is available for type elemental2.dom.Document; did you fet to inherit a required module?
.
.
.

What do I miss?

I have the elemental2-promise, elemental2-dom and elemental2-core in my pom.xml

I'm trying to get a div element with ID="calendarJS" and pass it to a constructor.

import elemental2.dom.Document;
import elemental2.dom.Element;
.
.
.
Element calendarEl = new Document().getElementById("calendarJS");

After loading the page the GWT compiler shows this error:

.
.
.
[ERROR] Line 133: No source code is available for type elemental2.dom.Element; did you fet to inherit a required module?
[ERROR] Line 133: No source code is available for type elemental2.dom.Document; did you fet to inherit a required module?
.
.
.

What do I miss?

I have the elemental2-promise, elemental2-dom and elemental2-core in my pom.xml

Share Improve this question asked Nov 20, 2024 at 23:55 RicardoRicardo 33 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 1

As the error says, did you fet to inherit the module in your .gwt.xml file? Adding it to the pom isn't enough.

You need to have

<inherits name="elemental2.dom.Dom"/>

in your .gwt.xml file to specify that you will use those sources.

本文标签: