Show
Ignore:
Timestamp:
11/30/2006 08:50:44 PM (2 years ago)
Author:
xue
Message:

TDataBoundControl will not throw exception if CurrentPageIndex? is out of range

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • branches/3.0/framework/Web/UI/WebControls/TDataBoundControl.php

    r1397 r1531  
    219219        { 
    220220                if(($value=TPropertyValue::ensureInteger($value))<0) 
    221                         throw new TInvalidDataValueException('databoundcontrol_currentpageindex_invalid',get_class($this)); 
     221                        $value=0; 
    222222                $this->setViewState('CurrentPageIndex',$value,0); 
    223223        } 
     
    338338                                $this->setViewState('PageCount',$ds->getPageCount()); 
    339339                                if($ds->getCurrentPageIndex()>=$ds->getPageCount()) 
    340                                         throw new TInvalidDataValueException('databoundcontrol_currentpageindex_invalid',get_class($this)); 
     340                                        $ds->setCurrentPageIndex($ds->getPageCount()-1); 
    341341                                $this->performDataBinding($ds); 
    342342                        }