<?
class frmMultiText3 extends MForm
{

    public function __construct()
    {   
        global $page;

        parent::__construct('Exemplo MultiTextField3');

        $options_arr1 = array('op1'=>'OpÃ§Ã£o1','op2'=>'OpÃ§Ã£o2','op3'=>'OpÃ§Ã£o3','op4'=>'OpÃ§Ã£o4','op5'=>'OpÃ§Ã£o5');
        $options_arr2 = array('op1','op2','op3','op4','op5');

        $lkp1 = new MLookupTextField('lkpAluno1','','Aluno',30);
 	    $lkp1->baseModule = 'example';
        $lkp1->module = 'example';
	    $lkp1->item = 'aluno';
	    $lkp1->event = 'filler';
	    $lkp1->related = 'id1,lkpAluno1';
        $lkp2 = new MLookupTextField('lkpAluno2','','Aluno',30);
 	    $lkp2->baseModule = 'example';
        $lkp2->module = 'example';
        $lkp2->item = 'aluno';
        $lkp2->event = 'filler';
        $lkp2->related = 'id2,lkpAluno2';

        $f = array(array('id','label','nome'));
        $f1 = array(
              new MTextField('id1','','Texto',20),
              $lkp1,
              new MSelection('selIdSistema1','','Sistema',$options_arr1)
        );
        $f2 = array(
              new MTextField('id2','','Texto',20),
              $lkp2,
              new MSelection('selIdSistema2','','Sistema',$options_arr1)
        );
        $fields = array( 
             new MMultiTextField3('mt1',null,'Exemplo 1 - layout vertical:',$f1,240,true,'vertical'),
             new MMultiTextField3('mt2',null,'Exemplo 2 - layout horizontal:',$f2,240,true,'horizontal'),
        );
        $this->setFields($fields);
        $this->setFieldAttr('mt1','info','This is the info attribute');
        $this->setFieldAttr('mt2','info','This is the info attribute');

        $buttons = Array(
           new MButton('btnPost', 'Enviar'),
        );
        $this->setButtons($buttons);
        if ( $page->isPostBack() )
        {
           $this->eventHandler();
        }
    }

    public function btnPost_click()
    {
       $value = $this->mt1->getCodeValue();
       $this->addField(new MTableRaw('Campo mt1',$value));
       $value = $this->mt2->getCodeValue();
       $this->addField(new MTableRaw('Campo mt2',$value));
    }

}

?>
