Packageorg.granite.tide.collections
Classpublic class PagedCollection
InheritancePagedCollection Inheritance mx.collections.ListCollectionView
SubclassesPagedQuery, PagedQuery

Base implementation of a paged collection that supports ItemPendingError.
The collection holds two complete pages of data.

Subclassed have to implement a getResult method that will retrieve a range of elements.



Public Properties
 PropertyDefined by
  beforeFindCall : Function = null
PagedCollection
  dispatchReplaceOnResult : Boolean
PagedCollection
  dispatchResetOnInit : Boolean
PagedCollection
  elementClass : Class
[write-only]
PagedCollection
  length : int
[read-only] Get total number of elements
PagedCollection
  list : IList
[write-only]
PagedCollection
  maxResults : int
[write-only] Set the page size.
PagedCollection
  multipleSort : Boolean = true
PagedCollection
  sort : Sort
PagedCollection
  throwIPEDuringResponders : Boolean = false
PagedCollection
  triggerRefreshOnIPEWithoutResponder : Boolean = false
PagedCollection
  uidProperty : String = "uid"
PagedCollection
Protected Properties
 PropertyDefined by
  _clientMax : int
PagedCollection
  _clientMaxSet : Boolean = false
PagedCollection
  _context : BaseContext = null
PagedCollection
  _initializing : Boolean = false
PagedCollection
Public Methods
 MethodDefined by
  
PagedCollection
  
clear():void
Clear collection content
PagedCollection
  
dispatchEvent(event:Event):Boolean
PagedCollection
  
fullRefresh():Boolean
Force refresh of collection when filter/sort have been changed
PagedCollection
  
getItemAt(index:int, prefetch:int = 0):Object
Override of getItemAt with ItemPendingError management
PagedCollection
  
getItemIndex(obj:Object):int
Override of getItemIndex
PagedCollection
  
meta_init(componentName:String, context:BaseContext):void
PagedCollection
  
refresh():Boolean
Refresh collection with new filter/sort parameters
PagedCollection
Protected Methods
 MethodDefined by
  
find(first:int, last:int, merge:Boolean = false):void
Abstract method: trigger a results query for the current filter
PagedCollection
  
getResult(event:TideResultEvent, first:int, max:int):Object
Build a result object from the result event
PagedCollection
  
itemUpdateHandler(event:PropertyChangeEvent):void
PagedCollection
  
startTrackUpdates(item:Object):void
PagedCollection
  
stopTrackUpdates(item:Object):void
PagedCollection
Public Constants
 ConstantDefined by
  COLLECTION_PAGE_CHANGE : String = "collectionPageChange"
[static]
PagedCollection
  FAULT : String = "fault"
[static]
PagedCollection
  RESULT : String = "result"
[static]
PagedCollection
Property detail
beforeFindCallproperty
public var beforeFindCall:Function = null
_clientMaxproperty 
protected var _clientMax:int
_clientMaxSetproperty 
protected var _clientMaxSet:Boolean = false
_contextproperty 
protected var _context:BaseContext = null
dispatchReplaceOnResultproperty 
public var dispatchReplaceOnResult:Boolean
dispatchResetOnInitproperty 
public var dispatchResetOnInit:Boolean
elementClassproperty 
elementClass:Class  [write-only]

This property can be used as the source for data binding.

Implementation
    public function set elementClass(value:Class):void
_initializingproperty 
protected var _initializing:Boolean = false
lengthproperty 
length:int  [read-only]

Get total number of elements

This property can be used as the source for data binding.

Implementation
    public function get length():int
listproperty 
list:IList  [write-only]

This property can be used as the source for data binding.

Implementation
    public function set list(value:IList):void
maxResultsproperty 
maxResults:int  [write-only]

Set the page size. The collection will store in memory twice this page size, and each server call will return at most the page size.

This property can be used as the source for data binding.

Implementation
    public function set maxResults(value:int):void
multipleSortproperty 
public var multipleSort:Boolean = true
sortproperty 
sort:Sort  [read-write]

This property can be used as the source for data binding.

Implementation
    public function get sort():Sort
    public function set sort(value:Sort):void
throwIPEDuringRespondersproperty 
public var throwIPEDuringResponders:Boolean = false
triggerRefreshOnIPEWithoutResponderproperty 
public var triggerRefreshOnIPEWithoutResponder:Boolean = false
uidPropertyproperty 
public var uidProperty:String = "uid"
Constructor detail
PagedCollection()constructor
public function PagedCollection()
Method detail
clear()method
public function clear():void

Clear collection content

dispatchEvent()method 
public override function dispatchEvent(event:Event):BooleanParameters
event:Event

Returns
Boolean
find()method 
protected function find(first:int, last:int, merge:Boolean = false):void

Abstract method: trigger a results query for the current filter

Parameters
first:int — : index of first required result
 
last:int — : index of last required result
 
merge:Boolean (default = false) — : should merge the result with the current wrapped list
fullRefresh()method 
public function fullRefresh():Boolean

Force refresh of collection when filter/sort have been changed

Returns
Boolean — always false
getItemAt()method 
public override function getItemAt(index:int, prefetch:int = 0):Object

Override of getItemAt with ItemPendingError management

Parameters
index:int — index of requested item
 
prefetch:int (default = 0) — not used

Returns
Object — object at specified index
getItemIndex()method 
public override function getItemIndex(obj:Object):int

Override of getItemIndex

Parameters
obj:Object — searched object

Returns
int — index of object in collection
getResult()method 
protected function getResult(event:TideResultEvent, first:int, max:int):Object

Build a result object from the result event

Parameters
event:TideResultEvent — the result event
 
first:int — first index requested
 
max:int — max elements requested

Returns
Object — an object containing data from the collection resultList : the retrieved data resultCount : the total count of elements (non paged) firstResult : the index of the first retrieved element maxResults : the maximum count of retrieved elements
itemUpdateHandler()method 
protected function itemUpdateHandler(event:PropertyChangeEvent):voidParameters
event:PropertyChangeEvent
meta_init()method 
public function meta_init(componentName:String, context:BaseContext):voidParameters
componentName:String
 
context:BaseContext
refresh()method 
public override function refresh():Boolean

Refresh collection with new filter/sort parameters

Returns
Boolean — always false
startTrackUpdates()method 
protected function startTrackUpdates(item:Object):voidParameters
item:Object
stopTrackUpdates()method 
protected function stopTrackUpdates(item:Object):voidParameters
item:Object
Constant detail
COLLECTION_PAGE_CHANGEconstant
public static const COLLECTION_PAGE_CHANGE:String = "collectionPageChange"
FAULTconstant 
public static const FAULT:String = "fault"
RESULTconstant 
public static const RESULT:String = "result"