Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Form create onEdit #105

Open
bjverde opened this issue Aug 22, 2023 · 0 comments
Open

Form create onEdit #105

bjverde opened this issue Aug 22, 2023 · 0 comments
Labels

Comments

@bjverde
Copy link
Owner

bjverde commented Aug 22, 2023

  • 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
        }
    }
bjverde pushed a commit that referenced this issue Jan 20, 2024
bjverde pushed a commit that referenced this issue Jan 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant