CellTable and GAE Datastore cursors

119 views
Skip to first unread message

George Moschovitis

unread,
Feb 1, 2011, 4:34:46 PM2/1/11
to google-we...@googlegroups.com
I would like to present data from a GAE Datastore table using a GWT CellTable.
Are there any best practices or (even better) a tutorial or sample that demonstrates how to implement
an AsyncDataProvider that works with Datastore cursors?

thanks in advance,
-g.

Miroslav Genov

unread,
Feb 2, 2011, 2:26:27 AM2/2/11
to google-we...@googlegroups.com
I think that they are not suitable each other, due the lack of rewind of datastore cursors, i.e you can seek to the next offset but you are not allowed to move back. To do that you have to make some kind of hack that keeps all previous cursor positions. For more information about paging you can take a look at http://sites.google.com/site/io/building-scalable-web-applications-with-google-app-engine (Slide 33-34). 

George Moschovitis

unread,
Feb 2, 2011, 4:14:07 AM2/2/11
to google-we...@googlegroups.com
I know how GAE datastore paging works...

I am looking to make this work in the context of GWT. I thought about a scheme of keeping old cursors, but I am wondering if there is a better/cleaner solution.

-g.

John LaBanca

unread,
Feb 2, 2011, 10:11:08 AM2/2/11
to google-we...@googlegroups.com, Daniel Rice (דניאל רייס)‎
We used GAE cursors for the Expenses sample that ships with GWT.  Take a look at the code in Report#findReportEntriesBySearch:
http://code.google.com/p/google-web-toolkit/source/browse/trunk/samples/expenses/src/main/java/com/google/gwt/sample/expenses/server/domain/Report.java

I don't know exactly how the code works, but it looks like we cache cursors on the server so we can reuse them later to fulfill a repeated query.

Thanks,
John LaBanca
jlab...@google.com


--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To post to this group, send email to google-we...@googlegroups.com.
To unsubscribe from this group, send email to google-web-tool...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.

George Moschovitis

unread,
Feb 3, 2011, 1:29:32 PM2/3/11
to google-we...@googlegroups.com
thanks for the pointer, will have a look...

-g.

gadev

unread,
Jul 4, 2011, 5:55:46 AM7/4/11
to google-we...@googlegroups.com
Hi (Kalimera)

I am in the same situation, I am trying to display datastore data on a celltable. To avoid having to page back and store cursors I place the celltable in a scrollpanel and when scroll reaches the end I change the range and the asyncdataprovider makes a new call to get new records. Finally, I add new records at the end of the list being displayed.

However, If I wanted to use pagination and page back I would probably store the cursors in the asyncdataprovider.

G :-)
Reply all
Reply to author
Forward
0 new messages