GWT (2.7) Compile fails when declaring a GwtQuery (1.0.6) Widget in UiBinder in GWTP (1.5.1) project

[亡魂溺海] 提交于 2020-01-06 19:33:29

问题


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.



来源:https://stackoverflow.com/questions/33785524/gwt-2-7-compile-fails-when-declaring-a-gwtquery-1-0-6-widget-in-uibinder-in

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!