renderBody of TDropDownList does not render additional
attributes. The code below incorporates some code from
TCheckBoxList which takes care of all the standard
attributes.
protected function renderBody()
{
$content="\n";
$formatString = $this->getDataTextFormatString();
foreach($this->getItems() as $item)
{
$text=$item->getText();
if(strlen($formatString))
$text=sprintf($formatString,$text);
if($this->isEncodeText())
$text=pradoEncodeData($text);
$value=$item->getValue();
$attr = $item->getAttributesToRender();
if(isset($attr['id'])) unset($attr['id']);
if(isset($attr['value'])) unset($attr['value']);
$attr = $item->renderAttributes($attr);
if($item->isSelected())
$content.='<option value="'.$value.'"
selected="selected" '.$attr.'>'.$text.'</option>'."\n";
else
$content.='<option value="'.$value.'"
'.$attr.'>'.$text.'</option>'."\n";
}
return $content;
}