Lançado Adianti Framework 7.6!
Clique aqui para saber mais
Data grid Window Ola, a todos. A fim de testar algumas funcionalidade, ( Data grid window ); Copie e executei o exemplo disponível no link abaixo. http://www.adianti.com.br/framework_files/tutor/index.php?class=DatagridInputDialogView&method=onReload Porem ao inserir e confirmar o dialogo. aparece a seguite mensagem: atal error: Uncaught Exception: Método AdiantiControlTAction::__construct deve...
RB
Data grid Window  
Ola, a todos.

A fim de testar algumas funcionalidade, ( Data grid window );

Copie e executei o exemplo disponível no link abaixo.
www.adianti.com.br/framework_files/tutor/index.php?class=DatagridInp

Porem ao inserir e confirmar o dialogo.

aparece a seguite mensagem:

atal error: Uncaught Exception: Método AdiantiControlTAction::__construct deve receber um parâmetro do tipo Callback
Verifique se a ação (DatagridInputDialogView::onReload) existe in /var/www/html/sgvo/lib/adianti/control/TAction.php on line 34

Alguem pode me dar uma luz...!

Pacotão Dominando o Adianti Framework 7
O material mais completo de treinamento do Framework.
Curso em vídeo aulas + Livro completo + Códigos fontes do projeto ERPHouse.
Conteúdo Atualizado! Versão 7.4


Dominando o Adianti 7 Quero me inscrever agora!

Comentários (4)


MG

Pela mensagem o método onReload não existe.
Poste o código para podermos dar uma olhada!
RB

Marcelo,

O código é o mesmo do www.adianti.com.br/framework_files/tutor/index.php?class=DatagridInp

  1. <?php
  2. /**
  3.  * DatagridInputDialogView
  4.  *
  5.  * @version    1.0
  6.  * @package    samples
  7.  * @subpackage tutor
  8.  * @author     Pablo Dall'Oglio
  9.  * @copyright  Copyright (c) 2006 Adianti Solutions Ltd. (http://www.adianti.com.br)
  10.  * @license    http://www.adianti.com.br/framework-license
  11.  */
  12. class DatagridInputDialogView extends TPage
  13. {
  14.     private $datagrid;
  15.     
  16.     public function __construct()
  17.     {
  18.         parent::__construct();
  19.         
  20.         // creates one datagrid
  21.         $this->datagrid = new TQuickGrid;
  22.         $this->datagrid->setHeight(320);
  23.         
  24.         // add the columns
  25.         $this->datagrid->addQuickColumn('Code',    'code',    'right''10%');
  26.         $this->datagrid->addQuickColumn('Name',    'name',    'left',  '30%');
  27.         $this->datagrid->addQuickColumn('Address''address''left',  '30%');
  28.         $this->datagrid->addQuickColumn('Phone',   'fone',    'left',  '30%');
  29.         
  30.         // add the actions
  31.         $this->datagrid->addQuickAction('Input',   new TDataGridAction(array($this'onInputDialog')), 'name''fa:external-link');
  32.         
  33.         // creates the datagrid model
  34.         $this->datagrid->createModel();
  35.         
  36.         // wrap the page content using vertical box
  37.         $vbox = new TVBox;
  38.         $vbox->add(new TXMLBreadCrumb('menu.xml'__CLASS__));
  39.         $vbox->add($this->datagrid);
  40.         parent::add($vbox);
  41.     }
  42.     
  43.     /**
  44.      * Load the data into the datagrid
  45.      */
  46.     function onReload()
  47.     {
  48.         $this->datagrid->clear();
  49.         
  50.         // add an regular object to the datagrid
  51.         $item = new StdClass;
  52.         $item->code     '1';
  53.         $item->name     'Fábio Locatelli';
  54.         $item->address  'Rua Expedicionario';
  55.         $item->fone     '1111-1111';
  56.         $this->datagrid->addItem($item);
  57.         
  58.         // add an regular object to the datagrid
  59.         $item = new StdClass;
  60.         $item->code     '2';
  61.         $item->name     'Julia Haubert';
  62.         $item->address  'Rua Expedicionarios';
  63.         $item->fone     '2222-2222';
  64.         $this->datagrid->addItem($item);
  65.         
  66.         // add an regular object to the datagrid
  67.         $item = new StdClass;
  68.         $item->code     '3';
  69.         $item->name     'Carlos Ranzi';
  70.         $item->address  'Rua Oliveira';
  71.         $item->fone     '3333-3333';
  72.         $this->datagrid->addItem($item);
  73.         
  74.         // add an regular object to the datagrid
  75.         $item = new StdClass;
  76.         $item->code     '4';
  77.         $item->name     'Daline DallOglio';
  78.         $item->address  'Rua Oliveira';
  79.         $item->fone     '4444-4444';
  80.         $this->datagrid->addItem($item);
  81.     }
  82.     
  83.     /**
  84.      * Open an input dialog
  85.      */
  86.     public function onInputDialog$param )
  87.     {
  88.         $name   = new TEntry('name');
  89.         $amount = new TEntry('amount');
  90.         $name->setValue($param['key']);
  91.         
  92.         $form = new TForm('input_form');
  93.         $form->style 'padding:20px';
  94.         
  95.         $table = new TTable;
  96.         $table->addRowSet( new TLabel('Name: '), $name );
  97.         $table->addRowSet$lbl = new TLabel('Amount: '), $amount );
  98.         $lbl->setFontColor('red');
  99.         
  100.         $form->setFields(array($name$amount));
  101.         $form->add($table);
  102.         
  103.         // show the input dialog
  104.         $action = new TAction(array($this'onConfirm'));
  105.         $action->setParameter('stay-open'1);
  106.         new TInputDialog('Input dialog'$form$action'Confirm');
  107.     }
  108.     
  109.     /**
  110.      * Show the input dialog data
  111.      */
  112.     public static function onConfirm$param )
  113.     {
  114.         if (isset($param['amount']) AND $param['amount']) // validate required field
  115.         {
  116.             new TMessage('info'"Name: "$param['name'] . '; Amount: ' $param['amount'], new TAction(array('DatagridInputDialogView''onReload')));
  117.         }
  118.         else
  119.         {
  120.             new TMessage('error''Amount is required');
  121.         }
  122.     }
  123.     
  124.     /**
  125.      * shows the page
  126.      */
  127.     function show()
  128.     {
  129.         $this->onReload();
  130.         parent::show();
  131.     }
  132. }
MG

É estranho, pois eu copiei o seu código e executei e funcionou!
RB

Marcelo, boa noite,

Encontrei o erro, esqueci de alterar o nome da classe na linha 34.... Valeu