GXT tricky issues

本文介绍了GXT开发中遇到的三个棘手问题及其解决办法:1. 缺少必需模块导致的错误,需要确保所有使用的类都包含在GWT应用程序中;2. 通过切换到服务器模式来获取更多日志信息以解决难以定位的问题;3. 解决枚举类型序列化问题的方法。

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
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值