public function render($writer)
{
if ($this->getHasControls()) {
$this->groupCells();
if ($this->_useEmptyTemplate) {
$control = new TWebControl();
$control->setID($this->getClientID());
$control->copyBaseAttributes($this);
if ($this->getHasStyle()) {
$control->getStyle()->copyFrom($this->getStyle());
}
$control->renderBeginTag($writer);
$this->renderContents($writer);
$control->renderEndTag($writer);
} else {
if ($this->getViewState('ItemCount', 0) > 0) {
$this->applyItemStyles();
if ($this->_topPager) {
$this->_topPager->renderControl($writer);
$writer->writeLine();
}
$this->renderTable($writer);
if ($this->_bottomPager) {
$writer->writeLine();
$this->_bottomPager->renderControl($writer);
}
}
}
}
}