diff options
author | xue <> | 2006-12-01 02:50:44 +0000 |
---|---|---|
committer | xue <> | 2006-12-01 02:50:44 +0000 |
commit | e4028427f97378efd18b63f8aa102ee07cae29fe (patch) | |
tree | bd6ef7a7f8d9fd2f4066cfed0af19818e74d1a13 /framework/Web | |
parent | f65a7202bf0c48e487aa8ec21115b709c69d8118 (diff) |
TDataBoundControl will not throw exception if CurrentPageIndex is out of range
Diffstat (limited to 'framework/Web')
-rw-r--r-- | framework/Web/UI/WebControls/TDataBoundControl.php | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/framework/Web/UI/WebControls/TDataBoundControl.php b/framework/Web/UI/WebControls/TDataBoundControl.php index 599bdef2..79175288 100644 --- a/framework/Web/UI/WebControls/TDataBoundControl.php +++ b/framework/Web/UI/WebControls/TDataBoundControl.php @@ -218,7 +218,7 @@ abstract class TDataBoundControl extends TWebControl public function setCurrentPageIndex($value)
{
if(($value=TPropertyValue::ensureInteger($value))<0)
- throw new TInvalidDataValueException('databoundcontrol_currentpageindex_invalid',get_class($this));
+ $value=0;
$this->setViewState('CurrentPageIndex',$value,0);
}
@@ -337,7 +337,7 @@ abstract class TDataBoundControl extends TWebControl $ds->setDataSource($data);
$this->setViewState('PageCount',$ds->getPageCount());
if($ds->getCurrentPageIndex()>=$ds->getPageCount())
- throw new TInvalidDataValueException('databoundcontrol_currentpageindex_invalid',get_class($this));
+ $ds->setCurrentPageIndex($ds->getPageCount()-1);
$this->performDataBinding($ds);
}
else
|