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...!

Curso Dominando o Adianti Framework

O material mais completo de treinamento do Framework.
Curso em vídeo aulas + Livro completo + Códigos fontes do projeto ERPHouse.
Conteúdo Atualizado!


Dominando o Adianti Framework 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. public function __construct()
  16. {
  17. parent::__construct();
  18. // creates one datagrid
  19. $this->datagrid = new TQuickGrid;
  20. $this->datagrid->setHeight(320);
  21. // add the columns
  22. $this->datagrid->addQuickColumn('Code', 'code', 'right', '10%');
  23. $this->datagrid->addQuickColumn('Name', 'name', 'left', '30%');
  24. $this->datagrid->addQuickColumn('Address', 'address', 'left', '30%');
  25. $this->datagrid->addQuickColumn('Phone', 'fone', 'left', '30%');
  26. // add the actions
  27. $this->datagrid->addQuickAction('Input', new TDataGridAction(array($this, 'onInputDialog')), 'name', 'fa:external-link');
  28. // creates the datagrid model
  29. $this->datagrid->createModel();
  30. // wrap the page content using vertical box
  31. $vbox = new TVBox;
  32. $vbox->add(new TXMLBreadCrumb('menu.xml', __CLASS__));
  33. $vbox->add($this->datagrid);
  34. parent::add($vbox);
  35. }
  36. /**
  37. * Load the data into the datagrid
  38. */
  39. function onReload()
  40. {
  41. $this->datagrid->clear();
  42. // add an regular object to the datagrid
  43. $item = new StdClass;
  44. $item->code = '1';
  45. $item->name = 'Fábio Locatelli';
  46. $item->address = 'Rua Expedicionario';
  47. $item->fone = '1111-1111';
  48. $this->datagrid->addItem($item);
  49. // add an regular object to the datagrid
  50. $item = new StdClass;
  51. $item->code = '2';
  52. $item->name = 'Julia Haubert';
  53. $item->address = 'Rua Expedicionarios';
  54. $item->fone = '2222-2222';
  55. $this->datagrid->addItem($item);
  56. // add an regular object to the datagrid
  57. $item = new StdClass;
  58. $item->code = '3';
  59. $item->name = 'Carlos Ranzi';
  60. $item->address = 'Rua Oliveira';
  61. $item->fone = '3333-3333';
  62. $this->datagrid->addItem($item);
  63. // add an regular object to the datagrid
  64. $item = new StdClass;
  65. $item->code = '4';
  66. $item->name = 'Daline DallOglio';
  67. $item->address = 'Rua Oliveira';
  68. $item->fone = '4444-4444';
  69. $this->datagrid->addItem($item);
  70. }
  71. /**
  72. * Open an input dialog
  73. */
  74. public function onInputDialog( $param )
  75. {
  76. $name = new TEntry('name');
  77. $amount = new TEntry('amount');
  78. $name->setValue($param['key']);
  79. $form = new TForm('input_form');
  80. $form->style = 'padding:20px';
  81. $table = new TTable;
  82. $table->addRowSet( new TLabel('Name: '), $name );
  83. $table->addRowSet( $lbl = new TLabel('Amount: '), $amount );
  84. $lbl->setFontColor('red');
  85. $form->setFields(array($name, $amount));
  86. $form->add($table);
  87. // show the input dialog
  88. $action = new TAction(array($this, 'onConfirm'));
  89. $action->setParameter('stay-open', 1);
  90. new TInputDialog('Input dialog', $form, $action, 'Confirm');
  91. }
  92. /**
  93. * Show the input dialog data
  94. */
  95. public static function onConfirm( $param )
  96. {
  97. if (isset($param['amount']) AND $param['amount']) // validate required field
  98. {
  99. new TMessage('info', "Name: ". $param['name'] . '; Amount: ' . $param['amount'], new TAction(array('DatagridInputDialogView', 'onReload')));
  100. }
  101. else
  102. {
  103. new TMessage('error', 'Amount is required');
  104. }
  105. }
  106. /**
  107. * shows the page
  108. */
  109. function show()
  110. {
  111. $this->onReload();
  112. parent::show();
  113. }
  114. }
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