how to use nextItemId() and prevItemId() with FreeFormQuery?

Hi ,I’ve been using Vaadin FreeFromQuery with FreeFormStatmentDelegate for a while,everything is fine.But when I tried to get access to the item next to the item selected in a table with nextItemId() I got nullpointer exception returned ,I think I need to modify the Delegate but I don’t know how,can anyone help me here?