public function getFocusElementID()
{
if (($id = $this->getViewState('FocusElementID', '')) === '') {
$target = $this->getValidationTarget();
/* Workaround: TCheckBoxList and TRadioButtonList nests the actual
* inputs inside a table; we ensure the first input gets focused
*/
if ($target instanceof TCheckBoxList && $target->getItemCount() > 0) {
$id = $target->getClientID() . '_c0';
} else {
$id = $target->getClientID();
}
}
return $id;
}