GWT (2.7) Compile fails when declaring a GwtQuery

2019-09-02 14:22发布

问题:

When I simply just declare a GwtQuery DragAndDropCellTree in my MyView.ui.xml UiBinder in my GWTP project, I cannot GWT Compile it:

[3]  xmlns:gq="urn:import:gwtquery.plugins.droppable.client.gwt"
...
[59]       <gq:DragAndDropCellTree></gq:DragAndDropCellTree>

[ERROR] No class matching "DragAndDropCellTree" in urn:import:gwtquery.plugins.droppable.client.gwt: < gq:DragAndDropCellTree > (:59)

[ERROR] Errors in 'gen/my/package/com_gwtplatform_mvp_client_DesktopGinjector_DesktopGinjectorGinjector_fragment.java' [ERROR] Failed to resolve 'my.package.MyView.Binder' via deferred binding

[WARN] For the following type(s), generated source was never committed (did you forget to call commit()?) [WARN] my.package.MyView_BinderImpl

I followed GwtQuery Configuration using Maven in Eclipse. I'm not sure if my problem lies in GWT, GWTP, Maven, or GwtQuery

Any ideas what I am doing wrong?

  • Without the declaration, but with the import in the UiBinder of gwtquery.plugins.droppable.client.gwt, I can successfully compile
  • I can successfully compile when making the declaration in MyView.java instead of UiBinder
  • I cannot compile when declaring any other DragAndDrop either, nor when declaring one in a different UiBinder

回答1:

I think I figured this one out. Any Widget used in UiBinder must have a zero-arg constructor...

DragAndDropCellTree does not have a zero-arg constructor. So it makes sense that I could declare in MyView.java but not MyView.ui.xml.

So this was a GWT <-> GwtQuery problem.

These are alternatives to still use UiBinder.