I’ve learned 3 tricky issue solutions today, of GXT, credit to genius Kevin.
- “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.
- 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.
- 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;
- dd
本文介绍了GXT开发中遇到的三个棘手问题及其解决办法:1. 缺少必需模块导致的错误,需要确保所有使用的类都包含在GWT应用程序中;2. 通过切换到服务器模式来获取更多日志信息以解决难以定位的问题;3. 解决枚举类型序列化问题的方法。
414

被折叠的 条评论
为什么被折叠?



