public function actionAddEmailMessage($moduleClassName, $type, $rowNumber)
 {
     $form = new WizardActiveForm();
     $form->id = WorkflowWizardView::getFormId();
     $form->enableAjaxValidation = true;
     //ensures error validation populates correctly
     $rowCounterInputId = ComponentForWorkflowWizardView::resolveRowCounterInputId(ComponentForWorkflowForm::TYPE_EMAIL_MESSAGES);
     $wizardFormClassName = WorkflowToWizardFormAdapter::getFormClassNameByType($type);
     $model = ComponentForWorkflowFormFactory::makeByComponentType($moduleClassName, $moduleClassName::getPrimaryModelName(), $type, ComponentForWorkflowForm::TYPE_EMAIL_MESSAGES);
     $inputPrefixData = array($wizardFormClassName, ComponentForWorkflowForm::TYPE_EMAIL_MESSAGES, (int) $rowNumber);
     $form->setInputPrefixData($inputPrefixData);
     $view = new EmailMessageRowForWorkflowComponentView($model, (int) $rowNumber, $inputPrefixData, $form, WorkflowToWizardFormAdapter::getFormClassNameByType($type), $rowCounterInputId);
     $content = $view->render();
     $form->renderAddAttributeErrorSettingsScript($view::getFormId());
     Yii::app()->getClientScript()->setToAjaxMode();
     Yii::app()->getClientScript()->render($content);
     echo $content;
 }
 /**
  * @param integer $rowCount
  * @param Array $emailMessages
  * @return array
  */
 protected function renderEmailMessages(&$rowCount, $emailMessages)
 {
     assert('is_int($rowCount)');
     assert('is_array($emailMessages)');
     $items = array();
     foreach ($emailMessages as $emailMessage) {
         $inputPrefixData = array(get_class($this->model), ComponentForWorkflowForm::TYPE_EMAIL_MESSAGES, (int) $rowCount);
         $rowCounterInputId = ComponentForWorkflowWizardView::resolveRowCounterInputId(ComponentForWorkflowForm::TYPE_EMAIL_MESSAGES);
         $view = new EmailMessageRowForWorkflowComponentView($emailMessage, $rowCount, $inputPrefixData, $this->form, get_class($this->model), $rowCounterInputId);
         $view->addWrapper = false;
         $items[] = array('content' => $view->render());
         $rowCount++;
     }
     return $items;
 }