SmartGWT数据源定制教程 [英] SmartGWT Datasource customization tutorial

查看:130
本文介绍了SmartGWT数据源定制教程的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在寻找一个关于如何在SmartGWT中自定义DataSource的好教程(代码示例现在也会这样做)。

一些细节: >
我有一个GWT项目,它使用专有的客户端 - 服务器协议来获取数据(使用基于GWT类的广泛的API)。服务器是基于非GWT的,即GWT仅用于客户端。

我想通过创建一个定制的数据源来使用SmartGWT的小部件,该数据源将与现有的GWT基础架构进行交互。 / p>

有人知道这样的资源吗?

编辑:



Charles Kendrick的答案适用于我。



对于一个有效的代码示例,您可以看到

解决方案

您可以通过覆盖transformRequest和transformResponse来完成此操作 - 请参阅这些方法的文档以获得概述:



http://www.smartclient.com/smar tgwtee / javadoc / com / smartgwt / client / data / DataSource.html#transformRequest(com.smartgwt.client.data.DSRequest)

http://www.smartclient.com/smartgwtee/javadoc/com/smartgwt/client/data/DataSource.html#transformResponse(com.smartgwt.client.data .DSResponse,%20com.smartgwt.client.data.DSRequest,%20java.lang.Object)


I'm looking for a good tutorial on how to customize a DataSource in SmartGWT (a code sample will also do for now).

Some details:
I have a GWT project which uses a proprietary client-server protocol for fetching data (with an extensive API based on GWT classes). The server is non-GWT based, i.e. GWT is used only for client side.
I'd like to use SmartGWT's widgets with this data by creating a custom DataSource which will interact with the existing GWT infrastructure.

Does anybody know of such a resource?

EDIT:

Charles Kendrick's answer worked for me.

For a working code example, you can see this.

解决方案

You do this via overrides of transformRequest and transformResponse - see the documentation of these methods for an overview:

http://www.smartclient.com/smartgwtee/javadoc/com/smartgwt/client/data/DataSource.html#transformRequest(com.smartgwt.client.data.DSRequest)

http://www.smartclient.com/smartgwtee/javadoc/com/smartgwt/client/data/DataSource.html#transformResponse(com.smartgwt.client.data.DSResponse,%20com.smartgwt.client.data.DSRequest,%20java.lang.Object)

这篇关于SmartGWT数据源定制教程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆