MM
Erro ao executar uma pagina a partir do studio
Criei um model e uma pagina no studio
Inseri o programa e direitos ao usuario user
Ao executar ocorre erro cfe anexo.
Class pais e tradecountrylist em anexo
Inseri o programa e direitos ao usuario user
Ao executar ocorre erro cfe anexo.
Class pais e tradecountrylist em anexo
- <?php
- /**
- * Pais Active Record
- * @author <your-name-here>
- */
- class Pais extends TRecord
- {
- const TABLENAME = 'public.trade_country';
- const PRIMARYKEY= 'id';
- const IDPOLICY = 'serial'; // {max, serial}
- /**
- * Constructor method
- */
- public function __construct($id = NULL, $callObjectLoad = TRUE)
- {
- parent::__construct($id, $callObjectLoad);
- parent::addAttribute('ds_country');
- }
- }
- *******************************************************************
- <?php
- /**
- * TradeCountryList Listing
- * @author <your name here>
- */
- class TradeCountryList extends TStandardList
- {
- protected $form; // registration form
- protected $datagrid; // listing
- protected $pageNavigation;
- protected $formgrid;
- protected $deleteButton;
- protected $transformCallback;
- /**
- * Page constructor
- */
- public function __construct()
- {
- parent::__construct();
- parent::setDatabase('Teste1'); // defines the database
- parent::setActiveRecord('TradeCountry'); // defines the active record
- parent::setDefaultOrder('id', 'asc'); // defines the default order
- // parent::setCriteria($criteria) // define a standard filter
- parent::addFilterField('id', 'like', 'id'); // filterField, operator, formField
- parent::addFilterField('ds_country', 'like', 'ds_country'); // filterField, operator, formField
- // creates the form
- $this->form = new TQuickForm('form_search_TradeCountry');
- $this->form->class = 'tform'; // change CSS class
- $this->form->style = 'display: table;width:100%'; // change style
- $this->form->setFormTitle('TradeCountry');
- // create the form fields
- $id = new TEntry('id');
- $ds_country = new TEntry('ds_country');
- // add the fields
- $this->form->addQuickField('Id', $id, 200 );
- $this->form->addQuickField('Ds Country', $ds_country, 200 );
- // keep the form filled during navigation with session data
- $this->form->setData( TSession::getValue('TradeCountry_filter_data') );
- // add the search form actions
- $this->form->addQuickAction(_t('Find'), new TAction(array($this, 'onSearch')), 'fa:search');
- $this->form->addQuickAction(_t('New'), new TAction(array('TradeCountryForm', 'onEdit')), 'bs:plus-sign green');
- // creates a DataGrid
- $this->datagrid = new TDataGrid;
- $this->datagrid->style = 'width: 100%';
- $this->datagrid->datatable = 'true';
- // $this->datagrid->enablePopover('Popover', 'Hi <b> {name} </b>');
- // creates the datagrid columns
- $column_id = new TDataGridColumn('id', 'Id', 'right');
- $column_ds_country = new TDataGridColumn('ds_country', 'Ds Country', 'left');
- // add the columns to the DataGrid
- $this->datagrid->addColumn($column_id);
- $this->datagrid->addColumn($column_ds_country);
- // create EDIT action
- $action_edit = new TDataGridAction(array('TradeCountryForm', 'onEdit'));
- $action_edit->setUseButton(TRUE);
- $action_edit->setButtonClass('btn btn-default');
- $action_edit->setLabel(_t('Edit'));
- $action_edit->setImage('fa:pencil-square-o blue fa-lg');
- $action_edit->setField('id');
- $this->datagrid->addAction($action_edit);
- // create DELETE action
- $action_del = new TDataGridAction(array($this, 'onDelete'));
- $action_del->setUseButton(TRUE);
- $action_del->setButtonClass('btn btn-default');
- $action_del->setLabel(_t('Delete'));
- $action_del->setImage('fa:trash-o red fa-lg');
- $action_del->setField('id');
- $this->datagrid->addAction($action_del);
- // create the datagrid model
- $this->datagrid->createModel();
- // create the page navigation
- $this->pageNavigation = new TPageNavigation;
- $this->pageNavigation->setAction(new TAction(array($this, 'onReload')));
- $this->pageNavigation->setWidth($this->datagrid->getWidth());
- // vertical box container
- $container = new TVBox;
- $container->style = 'width: 90%';
- // $container->add(new TXMLBreadCrumb('menu.xml', __CLASS__));
- $container->add($this->form);
- $container->add($this->datagrid);
- $container->add($this->pageNavigation);
- parent::add($container);
- }
- }
Linha 74
Esta sendo criado uma Action para a clase TradeCountryForm para o metodo onEdit
Tem duas coisas que pode fazer ou
1- Criar o formulario com o nome TradeCountryForm
2- Ou comenta a linha (mas dai fica a pergunta como vai ser imputado os Paises?)
Linha 53 mesma cois
Opa!
Crei um novo model e pagina paisform e paisformlist e nao deu erro de execucao na pagina.
O ondelete no grid funciona.
Mas o nova ou editar continua informando permissao negada
Deve cadastrar o Programa e logo apos adicionar esse programa para o Grupo de seu usuario
no Youtube tem isso
https://www.youtube.com/watch?v=RnbiddegOoQ