?>
		<?php 
echo $form->error($model, 'addresstypeid');
?>
	</div>
      </td>
	  <td>
        <div class="row">
		<?php 
echo $form->labelEx($model, 'materialgroupid');
echo $form->hiddenField($model, 'materialgroupid');
?>
          <input type="text" name="materialgroupcode" id="materialgroupcode" readonly >
          <?php 
$this->beginWidget('zii.widgets.jui.CJuiDialog', array('id' => 'materialgroup_dialog', 'options' => array('title' => Yii::t('app', 'Material Group'), 'width' => 'auto', 'autoOpen' => false, 'modal' => true)));
$materialgroup = new Materialgroup('searchwstatus');
$materialgroup->unsetAttributes();
// clear any default values
if (isset($_GET['Materialgroup'])) {
    $materialgroup->attributes = $_GET['Materialgroup'];
}
$this->widget('zii.widgets.grid.CGridView', array('id' => 'materialgroup-grid', 'dataProvider' => $materialgroup->Searchwstatus(), 'filter' => $materialgroup, 'template' => '{summary}{pager}<br>{items}{pager}{summary}', 'columns' => array(array('header' => '', 'type' => 'raw', 'value' => 'CHtml::Button("V",
                array("name" => "send_addresstype",
                "id" => "send_addresstype",
                "onClick" => "$(\\"#materialgroup_dialog\\").dialog(\\"close\\"); 
                $(\\"#materialgroupcode\\").val(\\"$data->materialgroupcode\\");
                $(\\"#Productbasic_materialgroupid\\").val(\\"$data->materialgroupid\\");"))'), array('name' => 'materialgroupid', 'visible' => false, 'value' => '$data->materialgroupid', 'htmlOptions' => array('width' => '1%')), 'materialgroupcode')));
$this->endWidget('zii.widgets.jui.CJuiDialog');
echo CHtml::Button('...', array('onclick' => '$("#materialgroup_dialog").dialog("open"); return false;'));
?>
		<?php 
 /**
  * Returns the data model based on the primary key given in the GET variable.
  * If the data model is not found, an HTTP exception will be raised.
  * @param integer the ID of the model to be loaded
  */
 public function loadModel($id)
 {
     $model = Materialgroup::model()->findByPk((int) $id);
     if ($model === null) {
         throw new CHttpException(404, 'The requested page does not exist.');
     }
     return $model;
 }