app/control/communication/SystemDocumentUploadForm.class.php
/**
     * Save form data
     * @param $param Request
     */
Save form data
@param $param Request
Save form data @param $param Request
public function onNext( $param )
    {
        try
        {
            $data = $this->form->getData(); 
            $this->form->validate(); 
            TSession::setValue('system_document_upload_file', $data->filename);
            if ($data->id)
            {
                $param['key'] = $param['id'];
                $param['hasfile'] = '1';
                AdiantiCoreApplication::loadPage('SystemDocumentForm', 'onEdit', $param);
            }
            else
            {
                $param['hasfile'] = '1';
                AdiantiCoreApplication::loadPage('SystemDocumentForm');
            }
        }
        catch (Exception $e) 
        {
            new TMessage('error', $e->getMessage()); 
            $this->form->setData( $this->form->getData() ); 
        }
    }
public function onNext ( $ param ) { try { $ data = $ this -> form -> getData ( ) ; $ this -> form -> validate ( ) ; TSession :: setValue ( 'system_document_upload_file' , $ data -> filename ) ; if ( $ data -> id ) { $ param [ 'key' ] = $ param [ 'id' ] ; $ param [ 'hasfile' ] = '1' ; AdiantiCoreApplication :: loadPage ( 'SystemDocumentForm' , 'onEdit' , $ param ) ; } else { $ param [ 'hasfile' ] = '1' ; AdiantiCoreApplication :: loadPage ( 'SystemDocumentForm' ) ; } } catch ( Exception $ e ) { new TMessage ( 'error' , $ e -> getMessage ( ) ) ; $ this -> form -> setData ( $ this -> form -> getData ( ) ) ; } }
Save form data
 @param $param Request
Save form data @param $param Request
// get form data as array // validate form data // in case of exception // shows the exception error message // keep form data