summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--HISTORY1
-rw-r--r--framework/Web/UI/WebControls/TDataBoundControl.php4
2 files changed, 3 insertions, 2 deletions
diff --git a/HISTORY b/HISTORY
index 2cf40d5c..79475402 100644
--- a/HISTORY
+++ b/HISTORY
@@ -13,6 +13,7 @@ CHG: Ticket#460 - Validators will not perform validation if parents are disabled
CHG: TDataGrid now does not set default table styles (Qiang)
CHG: TRepeater does not render <span> anymore for empty item template (Qiang)
CHG: THttpRequest.constructUrl() now encodes ampersand by default (Qiang)
+CHG: TDataBoundControl will not throw exception if CurrentPageIndex is out of range (Qiang)
Version 3.0.5 October 23, 2006
==============================
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