Export to GitHub

maashaack - issue #156

PagebyPageIterator problem with lastPage() method


Posted on May 7, 2009 by Swift Panda

Problem if a previous() method is invoked after a call of the lastPage() method.

Comment #1

Posted on May 7, 2009 by Swift Panda

For the moment if the lastPage() is invoked, and if the use must test if !it.hasPrevious... not use the it.previous() but it.current()

See the new example of the class :)

TODO : refactoring the example with external class

Comment #2

Posted on May 8, 2009 by Swift Panda

Not a bug but a fix when use the iterator, see the example : http://code.google.com/p/maashaack/source/browse/trunk/AS3/examples/maashaack/system/data/iterators/examples/PageByPageIteratorExample.as?spec=svn692&r=692

{{{ public function prev():void { var prev:* ; if ( !it.hasPrevious()) { prev = it.previous() ;
} else { it.lastPage() ; prev = it.current() ; } trace( "> prev:" + prev + " currentPage:" + it.currentPage() + " current:" + eden.serialize(it.current()) ) ; }

}}}

Comment #3

Posted on May 8, 2009 by Swift Panda

oops... problem in the up example :)

{{{ public function prev():void { var prev:* ; if ( it.hasPrevious()) { prev = it.previous() ;
} else { it.lastPage() ; prev = it.current() ; } trace( "> prev:" + prev + " currentPage:" + it.currentPage() + " current:" + eden.serialize(it.current()) ) ; }

}}}

remove the ! in the condition

Status: Fixed

Labels:
Type-Defect Priority-High Milestone-Release0.2 Project-ADT Component-UI