I'm developing a GXT application, and I've noticed that I'm not able to use objects in the package com.extjs.gxt.ui.client.widget
on the 开发者_运维技巧server-side. I guess this makes sense, since widgets can only be represented with JS+HTML. But I am able to use other things in the client
package in server code, such as com.extjs.gxt.ui.client.data.BaseModel
.
My question: Where can I find a list of what objects I can use in server-side code, and which ones I cannot? Is there a more general rule that I can follow?
Any info is appreciated, thanks.
-tjwNot sure if I can answer your question completely, but here is a hint: package com.extjs.gxt.ui.client.data (check http://dev.sencha.com/deploy/gxtdocs/index.html?overview-summary.html for the API) holds most implementations of things that can be sent through the wire.
However you'll need to check if a given class of that package (say BasePagingLoadResult or BaseModelData for example) implements java.io.Serializable. If it does, then you're good to go. Most classes of that same package that ends with Result or Config implements Serializable (actually I can't find one in that case that don't).
Widgets, as you already figured out, can't be sent through the wire (not Serializable).
Hope that helps!
精彩评论