[from Isomorphic: we strongly recommend against using GWT-RPC for reasons listed in the FAQ. The approach is this thread should only be used as a temporary solution and only if you have a large set of pre-existing GWT-RPC services]
Hi All,
After some testing already provided GWT-RPC data source implementation (sticky post) (it was good starting point) I've decided to write my own. After reading post on how to implement Google Gears ( http://forums.smartclient.com/showthread.php?t=1192 ) I've realized that SmartClient already has possibility to use custom servers to load data. After checking SmartClient sources I've found protocol (which is not included in smartGWT) - "clientCustom". Using this protocol in data source allows to call custom server on data operations. It is done by overriding transformRequest method. When protocol is set to "clientCustom" - SmartClient after calling transformRequest method expects call of method processResponse after asynchronous call to server finishes.
The only thing is missing - possibility to set "clientCustom" protocol in smartGWT.
Here is what you can do:
- download smartGWT sources
- edit file main/src/com/smartgwt/client/types/DSProtocol.java - add these lines just after enumeration declaration :
- build your own smartGWT as it is described in http://code.google.com/p/smartgwt/wiki/BuildingFromSVN
I really hope that smartGWT developers will include it in future releases.
Please find attached implementation of GWT-RPC data source
Working example with real GWT RPC services I will upload in next response - can not upload more than 5 files.
Any comments are welcome.
Aleksandras
Hi All,
After some testing already provided GWT-RPC data source implementation (sticky post) (it was good starting point) I've decided to write my own. After reading post on how to implement Google Gears ( http://forums.smartclient.com/showthread.php?t=1192 ) I've realized that SmartClient already has possibility to use custom servers to load data. After checking SmartClient sources I've found protocol (which is not included in smartGWT) - "clientCustom". Using this protocol in data source allows to call custom server on data operations. It is done by overriding transformRequest method. When protocol is set to "clientCustom" - SmartClient after calling transformRequest method expects call of method processResponse after asynchronous call to server finishes.
The only thing is missing - possibility to set "clientCustom" protocol in smartGWT.
Here is what you can do:
- download smartGWT sources
- edit file main/src/com/smartgwt/client/types/DSProtocol.java - add these lines just after enumeration declaration :
Code:
/** * dsRequest.data should be poplulated by custom call to server in transformRequest method. transformRequest should issue async request * to server and call processResponse on completion with created DSResponse object. If call was successful status and data should be filled. * If call was unsuccessful only status should contain error code. */ CLIENTCUSTOM("clientCustom"),
I really hope that smartGWT developers will include it in future releases.
Please find attached implementation of GWT-RPC data source
Working example with real GWT RPC services I will upload in next response - can not upload more than 5 files.
Any comments are welcome.
Aleksandras
Comment