public function getRating()
{
$rating = $this->getViewState('Rating', null);
if ($rating === null) {
return $this->getSelectedIndex() + 1;
} else {
return $rating;
}
}
/** * @param float rating value, also sets the selected Index */ public function setRating($value) { if (parent::getRating() === $value) { return; } parent::setRating($value); $value = $this->getRating(); $this->callClientFunction('setRating', $value); }