Skip to content

Form create onEdit #105

@bjverde

Description

@bjverde
  • FormList set class name e id

  • On Form create onEdit

    public function onEdit( $param )
    {
        try {
            if (isset($param['key'])) {
                $key = $param['key'];  // get the parameter $key
                TTransaction::open($this->database); // open a transaction
                $object = new Contato($key); // instantiates the Active Record 
                $this->form->setData($object); // fill the form 
                TTransaction::close(); // close the transaction 
            }else{
                $this->form->clear();
            }
        } catch (Exception $e) {
            new TMessage(TFormDinMessage::TYPE_ERROR, $e->getMessage()); // shows the exception error message
            TTransaction::rollback(); // undo all pending operations
        }
    }

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions