public function updateBean($data)
    {
        if ($this->currentBean ==null) {
            throw new NoBeanException();
        }

        $result = $this->saveBean($this->currentBean, $data);

        // Return result
        if (empty($result->msg)) {
            $result->msg = "Saved.";
            $result->class = "callout-info";
        } else {
            $result->class = "callout-danger";
        }

        if ($this->afterUpdateBean != null) {
            $callable = $this->afterUpdateBean;
            $callable($this->currentBean, $result);
        }

        return $result;
    }