I'm implementing some UI paging and trying to detect whether a record
exists beyond the current page (in order to show a "more" button).

I hoped to iterate over a result set of pageSize + 1, grabbing the
cursor as I pass the item @ pageSize, and then using the existence of
the last item to know there's more to be shown.  Unfortunately I can't
find a way to accomplish this using JDO.

JDOCursorHelper.getCursor(List<T>) is documented to get the cursor for
the last item in the list, so that works as documented but doesn't
help me.

JDOCursorHelper.getCursor(Iterator<T>) seems to be what I need, but
every Iterator that I can find to pass to it causes it to return
null.  I've tried passing ((List<T>)query.execute).iterator() as well
as ((QueryResult)query.execute).iterator() and both have the same
result.

Anyone know if there's a not-too-kludgy way to do this w/o requerying
the datastore for the additional item.  Or is it easier in Objectify
(I'm considering switching)?

Thanks much,

James

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.

Reply via email to