SmartGWT Datasource customization tutorial

2019-04-08 14:41发布

问题:

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.

回答1:

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)



标签: gwt smartgwt