public function renderField()
    {
        list($name, $id) = $this->resolveNameID();

        echo CHtml::openTag($this->tagName, array('id' => 'wrapper-' . $id));

        if ($this->hasModel()) {
            echo CHtml::activeCheckBox($this->model, $this->attribute, $this->htmlOptions);
        } else {
            echo CHtml::checkBox($name, $this->value, $this->htmlOptions);
        }

        echo CHtml::closeTag($this->tagName);
    }