Hi,
I am using SmartGWT LGPL client version (2.4), and a tomcat server, with Spring.
I'd like to integrate a rest spring server with your Datasource.
I also need that all edits (of a ListGrig) are sent togheter in a single browser request.
According to RPCManager Javadoc, I wrote:
But the queue doesn't seem to work. When I press the "Save" button, the RPCManager sends one post for each edited row.
Does queueing system works with the LGPL client?
Because I read that RestDatasource doesn't work with queues, I extended directly the DataSource class, and wrote this:
Assuming that queueing system doesn't work, I tryed to extend the Datasource (RestDatasource this time) and try to override some methods,
like update(). But it seems that overrinding methods other than transformRequest(...) and transformeResponse(...) (and a few others) does NOT work.
Is there a proper way to extend DataSource and in general SmartGWT classes? Note that overriding transformRequest(...) and transformeResponse(...)
is not enough to create a personal way for queueing operations.
Finally, is there any way to write a custom RPCManager?
Thanks for your attention.
I am using SmartGWT LGPL client version (2.4), and a tomcat server, with Spring.
I'd like to integrate a rest spring server with your Datasource.
I also need that all edits (of a ListGrig) are sent togheter in a single browser request.
According to RPCManager Javadoc, I wrote:
Code:
IButton save = new IButton("Save", new ClickHandler() { @Override public void onClick(ClickEvent event) { RPCManager.startQueue(); ordersGrid.saveAllEdits(); RPCManager.sendQueue(); } });
Does queueing system works with the LGPL client?
Because I read that RestDatasource doesn't work with queues, I extended directly the DataSource class, and wrote this:
Code:
public class OrdersDS extends DataSource { public static final OrdersDS INSTANCE = new OrdersDS(); private OrdersDS() { super(); setID("orders"); setDataFormat(DSDataFormat.JSON); setRecordXPath("/response/data"); //Configuration code omitted... OperationBinding fetch = new OperationBinding(); fetch.setOperationType(DSOperationType.FETCH); fetch.setDataProtocol(DSProtocol.POSTMESSAGE); fetch.setDataTransport(RPCTransport.XMLHTTPREQUEST); fetch.setDataURL("http://localhost:8080/myapp/dsrest/orders/fetch.json"); fetch.setDataFormat(DSDataFormat.JSON); OperationBinding update = new OperationBinding(); update.setOperationType(DSOperationType.UPDATE); update.setDataProtocol(DSProtocol.POSTMESSAGE); update.setDataTransport(RPCTransport.XMLHTTPREQUEST); update.setDataURL("http://localhost:8080/myapp/dsrest/orders/update.json"); update.setDataFormat(DSDataFormat.JSON); setOperationBindings(fetch,update); } @Override protected Object transformRequest(DSRequest dsRequest) { dsRequest.setContentType("application/json; charset=utf-8"); super.transformRequest(dsRequest); return JSON.encode(dsRequest.getData()); } }
Assuming that queueing system doesn't work, I tryed to extend the Datasource (RestDatasource this time) and try to override some methods,
like update(). But it seems that overrinding methods other than transformRequest(...) and transformeResponse(...) (and a few others) does NOT work.
Is there a proper way to extend DataSource and in general SmartGWT classes? Note that overriding transformRequest(...) and transformeResponse(...)
is not enough to create a personal way for queueing operations.
Finally, is there any way to write a custom RPCManager?
Thanks for your attention.
Comment