public function run()
    {
        if (!empty($this->_fields)) {
            throw new InvalidCallException('Each beginField() should have a matching endField() call.');
        }

        $id = $this->options['id'];
        $options = Json::encode($this->getClientOptions());
        $attributes = Json::encode($this->attributes);
        $view = $this->getView();
        AdminUiActiveForm::register($view);
        $view->registerJs("jQuery('#$id').yiiActiveForm($attributes, $options);");

        echo Html::endForm();
    }