`

GXT tricky issues

    博客分类:
  • GXT
阅读更多

I’ve learned 3 tricky issue solutions today, of GXT, credit to genius Kevin.

 

  1. “did you forget to inherit a required module” error.

This error is because, when GWT compiling Java source code into javascript, it needs the java code source code. If you in a GWT application, use a class which doesn’t in a GWT application, GXT can’t find the source code of this class. So, you need to refactor this class, move it into a GWT application.

 

Basically, it means, there should be a ${project_name}.gwt.xml config file in your root source folder of your app.

 

  1. Log amount of hosted mode and server mode.

Running in a hosted mode is fast and easy, but if you find some tricky issue which gives you very little log info, you should switch to server mode, under this mode, it will give you log information.

 

  1. Serialisation issue.

MarginCallDto extends the class BaseModelData. Basically it doesn't contain any fields, it will ask its base class to do the read/store actions. Also this class must be serialisable. I use a Enum class, which effectively can’t be serialized.

 

Solution to this is to add a dummyEnumVariable, just to let MarginCallDto know that, it will use this class. So, when GWT compiles this class, it will add the Enum staff.

 

    /**

     * This field is never used but it is required so that the GWT

     * compiler is aware that this class uses BigDecimal and MarginCallType.

     */

    @SuppressWarnings("unused")

    private BigDecimal dummyBigDecimal;

    @SuppressWarnings("unused")

 private MarginCallType dummyMarginCallType;

 

  1. dd
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics