The thing is that i had same problem/question while ago and this is the way to go.
In my apps, i do all form submissions via ajax, it is way better for the app itself (less processing) and for the client because while the app is doing the processing i can show a nice message to client letting him know the application is doing some work and he needs to wait (also i lock the form to prevent double submissions)
You can take a look at the MessageStack extension, this is one of the reasons i created it, it simplifies my workflow very much, basically in my controller i have something like:
$msg = $product->saveModel(Yii::app()->input->post());
And the saveModel model method does something like:
public function saveModel(array $data)
$msg=Yii::app()->messageStack->reset()->setIsError()->set('action', $this->isNewRecord ? 'create':'update');
$this->attributes = $productData;
$isNewRecord = $this->isNewRecord;
throw new Exception(CHtml::errorSummary($this));
return $msg->set('msg', $e->getMessage());
return $msg->setIsSuccess()->set('redirect', Yii::app()->createUrl('product'));
As you see from my model i return the messageStack object itself, which will call toJson() in the controller which will cause the application to end and print all the stored data in a json format.
Having in mind the request has been made via ajax, this response can now be read in the callback of the ajax call and we can use returned variables as we want.(ie window.location.href=object.redirect or show the obj.msg to the client, because this contains an error message which needs to be seen)
Anyway, there are other ways to do all this stuff, but this is mine and it works perfectly