GXT tricky issues

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
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值