public function addParsedObject($object)
{
// Do not add items from template if items are loaded from viewstate
if (!$this->_stateLoaded && $object instanceof TListItem) {
$index = $this->getItems()->add($object);
if ($this->_cachedSelectedValue !== null && $this->_cachedSelectedValue === $object->getValue() || $this->_cachedSelectedIndex === $index) {
$object->setSelected(true);
$this->_cachedSelectedValue = null;
$this->_cachedSelectedIndex = -1;
}
}
}