diff options
author | xue <> | 2006-01-12 13:35:40 +0000 |
---|---|---|
committer | xue <> | 2006-01-12 13:35:40 +0000 |
commit | 823ddf3e3fbeb3cf5b30da257d868af743bf3302 (patch) | |
tree | 24bd3cf448b45310bc0c6fc6dd234d97bec60dfc /framework/Web/UI/WebControls/TRepeater.php | |
parent | e126c0067e9efee6542d08bf649588e2cf3a5924 (diff) |
Diffstat (limited to 'framework/Web/UI/WebControls/TRepeater.php')
-rw-r--r-- | framework/Web/UI/WebControls/TRepeater.php | 58 |
1 files changed, 33 insertions, 25 deletions
diff --git a/framework/Web/UI/WebControls/TRepeater.php b/framework/Web/UI/WebControls/TRepeater.php index 342a764b..f46d2929 100644 --- a/framework/Web/UI/WebControls/TRepeater.php +++ b/framework/Web/UI/WebControls/TRepeater.php @@ -254,31 +254,6 @@ class TRepeater extends TDataBoundControl implements INamingContainer return $item;
}
- protected function restoreItemsFromViewState()
- {
- $this->getControls()->clear();
- $items=$this->getItems();
- $items->clear();
- $this->_header=null;
- $this->_footer=null;
- if(($itemCount=$this->getViewState('ItemCount',0))>0)
- {
- if($this->_headerTemplate!=='')
- $this->_header=$this->createItemInternal(-1,'Header',false,null);
- $hasSeparator=$this->_separatorTemplate!=='';
- for($i=0;$i<$itemCount;++$i)
- {
- if($hasSeparator && $i>0)
- $this->createItemInternal($i-1,'Separator',false,null);
- $itemType=$i%2==0?'Item':'AlternatingItem';
- $items->add($this->createItemInternal($i,$itemType,false,null));
- }
- if($this->_footerTemplate!=='')
- $this->_footer=$this->createItemInternal(-1,'Footer',false,null);
- }
- $this->clearChildState();
- }
-
/**
* Saves items into viewstate.
* This method is invoked right before control state is to be saved.
@@ -304,6 +279,35 @@ class TRepeater extends TDataBoundControl implements INamingContainer $this->clearViewState('ItemCount');
}
+ protected function restoreItemsFromViewState()
+ {
+ $this->getControls()->clear();
+ $items=$this->getItems();
+ $items->clear();
+ $this->_header=null;
+ $this->_footer=null;
+ if(($itemCount=$this->getViewState('ItemCount',0))>0)
+ {
+ if($this->_headerTemplate!=='')
+ $this->_header=$this->createItemInternal(-1,'Header',false,null);
+ $hasSeparator=$this->_separatorTemplate!=='';
+ for($i=0;$i<$itemCount;++$i)
+ {
+ if($hasSeparator && $i>0)
+ $this->createItemInternal($i-1,'Separator',false,null);
+ $itemType=$i%2==0?'Item':'AlternatingItem';
+ $items->add($this->createItemInternal($i,$itemType,false,null));
+ }
+ if($this->_footerTemplate!=='')
+ $this->_footer=$this->createItemInternal(-1,'Footer',false,null);
+ }
+ else if($this->_emptyTemplate!=='')
+ {
+ $this->_empty=$this->createItemInternal(-1,'Empty',false,null);
+ }
+ $this->clearChildState();
+ }
+
/**
* Performs databinding to populate list items from data source.
* This method is invoked by dataBind().
@@ -335,7 +339,11 @@ class TRepeater extends TDataBoundControl implements INamingContainer $this->setViewState('ItemCount',$itemIndex,0);
}
else
+ {
+ if($this->_emptyTemplate!=='')
+ $this->_empty=$this->createItemInternal(-1,'Empty',false,null);
$this->setViewState('ItemCount',$itemIndex,-1);
+ }
}
/**
|