Changeset 1531 for branches/3.0

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

Location:
branches/3.0
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • branches/3.0/HISTORY

    r1529 r1531  
    1414CHG: TRepeater does not render <span> anymore for empty item template (Qiang) 
    1515CHG: THttpRequest.constructUrl() now encodes ampersand by default (Qiang) 
     16CHG: TDataBoundControl will not throw exception if CurrentPageIndex is out of range (Qiang) 
    1617 
    1718Version 3.0.5 October 23, 2006 
  • 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                        }