ItemPendingError

59 views
Skip to first unread message

trinity6nine

unread,
Feb 23, 2012, 9:54:35 PM2/23/12
to Granite Data Services Forum
Hi,

I'm using Flex 4.0 and GraniteDS 2.3.0.GA
I have a PagedQuery Collection used as the data provider for a
DataGrid.
Whenever I scroll down the DataGrid, the application throws an
ItemPending error. I've read that Tide Query integration is supposed
to manage this.
What am I doing wrong?

----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
CLIENT CODE
*****************
Seam.getInstance().addComponentWithFactory("trainingEventList",
PagedQuery, { maxResults: 36 });

[In]
public var trainingEventList:PagedQuery;

<mx:DataGrid id="dgTrainingEvent" dataProvider="{trainingEventList}"
width="100%" height="100%" liveScrolling="false">
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
SERVER CODE
*******************
package org.session;

import org.entity.*;
import org.jboss.seam.annotations.Name;
import org.jboss.seam.framework.EntityQuery;
import java.util.Arrays;

@Name("trainingEventList")
public class TrainingEventList extends EntityQuery<TrainingEvent> {

private static final long serialVersionUID = 1L;

private static final String EJBQL = "select trainingEvent from
TrainingEvent trainingEvent";

private static final String[] RESTRICTIONS = {
"lower(trainingEvent.name) like
lower(concat(#{trainingEventFilter.name},'%'))",
};

private TrainingEvent trainingEvent = new TrainingEvent();

public TrainingEventList() {
setEjbql(EJBQL);
setRestrictionExpressionStrings(Arrays.asList(RESTRICTIONS));
setMaxResults(25);
}

public TrainingEvent getTrainingEvent() {
return trainingEvent;
}
}
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

ERROR
*********
Error: Items pending from 132 to 204 for index 168
at org.granite.tide.collections::PagedCollection/getItemAt()[/Users/
franckwolff/Developments/workspace/graniteds/as3/framework/org/granite/
tide/collections/PagedCollection.as:708]
at ListCollectionViewCursor/seek()[E:\dev\4.x\frameworks\projects
\framework\src\mx\collections\ListCollectionView.as:2434]
at mx.controls.listClasses::ListBase/seekPositionSafely()[E:\dev\4.x
\frameworks\projects\framework\src\mx\controls\listClasses\ListBase.as:
4780]
at mx.controls.listClasses::ListBase/makeRowsAndColumnsWithExtraRows()
[E:\dev\4.x\frameworks\projects\framework\src\mx\controls\listClasses
\ListBase.as:1732]
at mx.controls.listClasses::ListBase/set verticalScrollPosition()[E:
\dev\4.x\frameworks\projects\framework\src\mx\controls\listClasses
\ListBase.as:1692]
at mx.controls::DataGrid/set verticalScrollPosition()[E:\dev\4.x
\frameworks\projects\framework\src\mx\controls\DataGrid.as:1118]
at mx.controls::DataGrid/scrollHandler()[E:\dev\4.x\frameworks
\projects\framework\src\mx\controls\DataGrid.as:2279]
at flash.events::EventDispatcher/dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at mx.core::UIComponent/dispatchEvent()[E:\dev\4.x\frameworks\projects
\framework\src\mx\core\UIComponent.as:12528]
at mx.controls.scrollClasses::ScrollBar/http://www.adobe.com/2006/
flex/mx/internal::dispatchScrollEvent()[E:\dev\4.x\frameworks\projects
\framework\src\mx\controls\scrollClasses\ScrollBar.as:1438]
at mx.controls.scrollClasses::ScrollThumb/stopDragThumb()[E:\dev\4.x
\frameworks\projects\framework\src\mx\controls\scrollClasses
\ScrollThumb.as:143]
at mx.controls.scrollClasses::ScrollThumb/http://www.adobe.com/2006/
flex/mx/internal::buttonReleased()[E:\dev\4.x\frameworks\projects
\framework\src\mx\controls\scrollClasses\ScrollThumb.as:108]
at mx.controls::Button/mouseUpHandler()[E:\dev\4.x\frameworks\projects
\framework\src\mx\controls\Button.as:2754]

Dahn Maier

unread,
Feb 25, 2012, 10:27:14 AM2/25/12
to gran...@googlegroups.com
You need to wrap the collection in an AsynListView which knows how to handle the item pending error

trinity6nine

unread,
Feb 25, 2012, 6:11:05 PM2/25/12
to Granite Data Services Forum
Thanks for your reply.

I tried that and I I keep the Datagrid I still get an error.

If I switch to the Spark DataGroup control the server is infinitely
polled for data.

On Feb 25, 5:27 pm, Dahn Maier <maierdes...@gmail.com> wrote:
> You need to wrap the collection in an AsynListView which knows how to handle the item pending error
>
> http://opensource.adobe.com/wiki/display/flexsdk/AsyncListView+Specif...

Dahn Maier

unread,
Feb 25, 2012, 7:03:33 PM2/25/12
to gran...@googlegroups.com
Can you please post your mxml? Also how are you bootstrapping your
paged query? (filter, method name, component etc.)

Dahn

trinity6nine

unread,
Feb 26, 2012, 12:43:21 PM2/26/12
to Granite Data Services Forum
I'm using a Seam Query component (session bean) that is injected into
a PagedQuery component in Flex.

The client and server code is in my first post on this thread.

I appreciate the help and please let me know if there's any other code
you require so that we can troubleshoot this.

On Feb 26, 2:03 am, Dahn Maier <maierdes...@gmail.com> wrote:
> Can you please post your mxml? Also how are you bootstrapping your
> paged query? (filter, method name, component etc.)
>
> Dahn
>

wdrai

unread,
Mar 5, 2012, 11:01:26 AM3/5/12
to gran...@googlegroups.com
It may be a bug. 
Can you try increasing the client and server page size (maxResults) and check if you still get the problem.
If yes can you post a JIRA with the exact versions of Flex and GraniteDS you are using (even build number for Flex).

Gregory Naidu

unread,
Mar 6, 2012, 7:01:53 AM3/6/12
to gran...@googlegroups.com
I tried your suggestion but it was unsuccessful (maxresults was 36 previously)

SERVER
----------
public EmployeeList() {
setEjbql(EJBQL);
setRestrictionExpressionStrings(Arrays.asList(RESTRICTIONS));
setMaxResults(72);
}

CLIENT
--------
    Seam.getInstance().addComponentWithFactory("employeeList", PagedQuery, { maxResults: 72 }, false, true, Tide.RESTRICT_YES);
            
    [Bindable] [In]
    public var employeeList:PagedQuery;

----------------------------------------------------------------------------------
I'll post a JIRA shortly
Reply all
Reply to author
Forward
0 new messages