public function init()
{
if (is_object($this->element) && $this->field) {
$this->value = $this->element->{$this->field};
}
// if the widget has javascript, load it in
if (file_exists('protected/widgets/js/' . get_class($this) . '.js')) {
$assetManager = Yii::app()->getAssetManager();
$asset_folder = $assetManager->publish('protected/widgets/js');
$assetManager->registerScriptFile('js/' . get_class($this) . '.js', 'application.widgets', $this->scriptPriority);
}
$this->htmlOptions['autocomplete'] = Yii::app()->params['html_autocomplete'];
}