I've added DSrequest to the signatures and made operations that don't have endpoints defined fall back to the default behavior. I also corrected a bug in the add dispatching while in bulk mode and removed some dead code.
nlotz:
That makes sense, how can I get this code into extensions?
roar:
In fact my backend only stores Stocks which only have names. Whenever I fetch from the backend I create StockPrices with random price data in the other two fields. You're right that it's not the most realistic example in the world.
Announcement
Collapse
No announcement yet.
X
-
Where are those gwt extensions? I could not check out any thing!
Originally posted by nlotzCould you add that to smartgwt-extensions ?
http://code.google.com/p/smartgwt-extensions
I could set up automated builds plus a Maven repository, enabling us to get updates automatically.
Leave a comment:
-
Can you provide any example, how to pass startrow, endrow parameter from datasource to callback, please?
My result contains more than 50k rows, and it hangs browser.
Leave a comment:
-
How about TreeGrids?
Has anybody been able to make this work with TreeGrid?
Leave a comment:
-
Pagination and filters
Hi, I'm using this solution and it's quite stable and simple. But I haven't still figured out how I can manage pagination and filters in the fetch endpoint.
Can someone give me some hints about this.
Thank you
Bit
Leave a comment:
-
In the example code, the addStock and editStock methods only take the stock symbol as parameter, like this:
Code:stockService.addStock(record.getAttribute("symbol"), callback); stockService.editStock(record.getAttributeAsInt("id"), record.getAttribute("symbol"), callback);
Wouldn't the example be more realistic if those methods took a StockPrice object instead, created inside the callEndpoint methods? Or is it something I missed?
Leave a comment:
-
Originally posted by benjaminberryI plan to post a revised version this weekend.
http://code.google.com/p/smartgwt-extensions
I could set up automated builds plus a Maven repository, enabling us to get updates automatically.
Leave a comment:
-
Impiastro,
You're right there is a bug there. More broadly things don't behave correctly if remove/add/update is used and no endpoint (or the endpoint does not use the callback) is set. I will update the base class to correct this problem.
Mihai007,
I haven't tried myself but this was something I wanted to look into this weekend.
I plan to change the signature of callEndpoint to make the DSRequest available to the callbacks in case the request is used for advanced control. I plan to change the signature for remove/add/update so that the record or record array are available outside of the parameters list so that you can use the same indices for input and output. I also left some embarrassing dead code in that I need to pull out.
If anyone has any other use cases it would be interesting to consider let me know. I plan to post a revised version this weekend.
Benjamin
Leave a comment:
-
do you think this could be used to lazy load records only when displaying them?
Leave a comment:
-
I found the problem
Just call:
Code:callback.onSuccess(record);
Code:setUpdateEndpoint(new GwtRpcDataSourceEndpoint<CategorieVociBase>() { @Override public void callEndpoint(AsyncCallback callback, Object... parameters) { ListGridRecord record = (ListGridRecord) parameters[0]; callback.onSuccess(record); }});
Leave a comment:
-
Problems in updating DataSource
Thank you Benjamin for your code, I was searching this kind of solution in managing smartclient datasources.
So I used your code and created my DataSource extending GwtRpcDataSource<T>.
But now I have a strange problem...
I have got a Panel with 2 tabs inside. The first tab contains a ListGrid attached to our DataSource called CategorieVociBaseDS (which extends GwtRpcDataSource<CategorieVociBase>). On double click on a record row another tab is opened with a dynamic form bounded to the same DataSource.
At the bottom of the dynamic form there is a "save" button calling the form saveData method.
All endpoints seem correctly called but after changing a record in the dynamic form and saving the record the datasource seems not changed.
So apparently I have a read only data source. The fetch populates correclty the list grid at the beginning but no other changes are tracked.
Any ideas about this behaviour?
I attached CategorieVociBaseDS and CategorieVociPanel
Leave a comment:
-
Thanks Ben, that's definitely the most complete and easiest to re-use example that anyone's posted to date. We'll mark this thread sticky.
Leave a comment:
-
Thank you for taking the time to do this. It is greatly appreciated.
Leave a comment:
-
I've just tried it. It works nicely, and it makes my own "hack" seem overcomplicated.
I will use this code while waiting for the official SmartGWT solution.
Thanks Ben, this is a nice effort for the community.
Leave a comment:
Leave a comment: