Lançado Adianti Framework 7.6!
Clique aqui para saber mais
Erro SetID BootstrapDatagridWrapper Form Mestre/Detalhe ( ! ) Warning: call_user_func_array() expects parameter 1 to be a valid callback, class 'AdiantiWidgetWrapperTQuickGrid' does not have a method 'setId' in D:wamp64wwwrrnewslibadiantiwrapperBootstrapDatagridWrapper.php on line 35 Criei um form mestre/detalhe de noticias e as fotos da noticia esta tudo certinho mais ao acessar o form da esse erro, nao sei o que é olhei rodei o tutor e ...
MG
Erro SetID BootstrapDatagridWrapper Form Mestre/Detalhe  
( ! ) Warning: call_user_func_array() expects parameter 1 to be a valid callback, class 'AdiantiWidgetWrapperTQuickGrid' does not have a method 'setId' in D:wamp64wwwrrnewslibadiantiwrapperBootstrapDatagridWrapper.php on line 35

Criei um form mestre/detalhe de noticias e as fotos da noticia esta tudo certinho mais ao acessar o form da esse erro, nao sei o que é olhei rodei o tutor e funciona perfeitamente alguem poderia me ajudar?

Curso completo Meu Negócio Pronto
Use para si, ou transforme em um negócio: Inclui aulas e códigos-fontes
Gestor de conteúdo (SITE) + Loja Virtual (E-Commerce) + Emissor de Notas para infoprodutos


Meu negócio pronto Quero me inscrever agora!

Comentários (4)


RF

Boa noite Maria Regina,

na classe NoticiaForm.class.php, linha 63, está tentando chamar o método setId() que não existe na classe pai.

Com isso a função "call_user_func_array()" fica experando um parâmetro para validar na classe TQuickGrid.

Verifque as funções da TQuickGrid de chamada de chamada de Id.

Sou novato no Adianti, mas espero ter ajudado em alguma coisa.
MG

Rafael,

Boa noite, obrigado pela dica! mais não está dando certo eu gerei direto pelo studio adianti framework.
Veja abaixo:

class NoticiaForm extends TPage
{
protected $form; // form
protected $detail_list;

/**
* Page constructor
*/
public function __construct()
{
parent::__construct();

// creates the form
$this->form = new BootstrapFormBuilder('form_noticia');
$this->form->setFormTitle('noticia');

// master fields
$idnoticia = new TEntry('idnoticia');
$titulo = new TEntry('titulo');
$subtitulo = new TEntry('subtitulo');
$descricao = new TEntry('descricao');
$datanoticia = new TDate('datanoticia');
$cidade_idcidade = new TEntry('cidade_idcidade');
$categoria_idcategoria = new TEntry('categoria_idcategoria');
$tiponoticia_idtiponoticia = new TEntry('tiponoticia_idtiponoticia');
$autor_idautor = new TEntry('autor_idautor');

// detail fields
$idgalerianoticia = new THidden('idgalerianoticia');
$engalerianoticia = new TEntry('engalerianoticia');

if (!empty($idnoticia))
{
$idnoticia->setEditable(FALSE);
}

// master fields
$this->form->addFields( [new TLabel('Idnoticia')], [$idnoticia] );
$this->form->addFields( [new TLabel('Titulo')], [$titulo] );
$this->form->addFields( [new TLabel('Subtitulo')], [$subtitulo] );
$this->form->addFields( [new TLabel('Descricao')], [$descricao] );
$this->form->addFields( [new TLabel('Datanoticia')], [$datanoticia] );
$this->form->addFields( [new TLabel('Cidade Idcidade')], [$cidade_idcidade] );
$this->form->addFields( [new TLabel('Categoria Idcategoria')], [$categoria_idcategoria] );
$this->form->addFields( [new TLabel('Tiponoticia Idtiponoticia')], [$tiponoticia_idtiponoticia] );
$this->form->addFields( [new TLabel('Autor Idautor')], [$autor_idautor] );

// detail fields
$this->form->addContent( ['<h4>Details</h4><hr>'] );
$this->form->addFields( [$idgalerianoticia] );

$this->form->addFields( [new TLabel('Engalerianoticia')], [$engalerianoticia] );

$add = TButton::create('add', [$this, 'onSaveDetail'], 'Register', 'fa:save');
$this->form->addFields( [], [$add] )->style = 'background: whitesmoke; padding: 5px; margin: 1px;';

$this->detail_list = new BootstrapDatagridWrapper(new TQuickGrid);
$this->detail_list->style = "min-width: 700px; width:100%;margin-bottom: 10px";
$this->detail_list->setId('noticia_list');

// items
$this->detail_list->addQuickColumn('Engalerianoticia', 'engalerianoticia', 'left', 100);

// detail actions
$this->detail_list->addQuickAction( 'Edit', new TDataGridAction([$this, 'onEditDetail']), 'idgalerianoticia', 'fa:edit blue');
$this->detail_list->addQuickAction( 'Delete', new TDataGridAction([$this, 'onDeleteDetail']), 'idgalerianoticia', 'fa:trash red');
$this->detail_list->createModel();

$panel = new TPanelGroup;
$panel->add($this->detail_list);
$panel->getBody()->style = 'overflow-x:auto';
$this->form->addContent( [$panel] );

$btn = $this->form->addAction( 'Save', new TAction([$this, 'onSave']), 'fa:save');
$btn->class = 'btn btn-sm btn-primary';
$this->form->addAction('Clear', new TAction([$this, 'onClear']), 'fa:eraser red');

// create the page container
$container = new TVBox;
$container->style = 'width: 90%';
// $container->add(new TXMLBreadCrumb('menu.xml', __CLASS__));
$container->add($this->form);
parent::add($container);
}
MG

Rafael,

Boa noite, obrigado pela dica! mais não está dando certo eu gerei direto pelo studio adianti framework.
Veja abaixo:

class NoticiaForm extends TPage
{
protected $form; // form
protected $detail_list;

/**
* Page constructor
*/
public function __construct()
{
parent::__construct();

// creates the form
$this->form = new BootstrapFormBuilder('form_noticia');
$this->form->setFormTitle('noticia');

// master fields
$idnoticia = new TEntry('idnoticia');
$titulo = new TEntry('titulo');
$subtitulo = new TEntry('subtitulo');
$descricao = new TEntry('descricao');
$datanoticia = new TDate('datanoticia');
$cidade_idcidade = new TEntry('cidade_idcidade');
$categoria_idcategoria = new TEntry('categoria_idcategoria');
$tiponoticia_idtiponoticia = new TEntry('tiponoticia_idtiponoticia');
$autor_idautor = new TEntry('autor_idautor');

// detail fields
$idgalerianoticia = new THidden('idgalerianoticia');
$engalerianoticia = new TEntry('engalerianoticia');

if (!empty($idnoticia))
{
$idnoticia->setEditable(FALSE);
}

// master fields
$this->form->addFields( [new TLabel('Idnoticia')], [$idnoticia] );
$this->form->addFields( [new TLabel('Titulo')], [$titulo] );
$this->form->addFields( [new TLabel('Subtitulo')], [$subtitulo] );
$this->form->addFields( [new TLabel('Descricao')], [$descricao] );
$this->form->addFields( [new TLabel('Datanoticia')], [$datanoticia] );
$this->form->addFields( [new TLabel('Cidade Idcidade')], [$cidade_idcidade] );
$this->form->addFields( [new TLabel('Categoria Idcategoria')], [$categoria_idcategoria] );
$this->form->addFields( [new TLabel('Tiponoticia Idtiponoticia')], [$tiponoticia_idtiponoticia] );
$this->form->addFields( [new TLabel('Autor Idautor')], [$autor_idautor] );

// detail fields
$this->form->addContent( ['<h4>Details</h4><hr>'] );
$this->form->addFields( [$idgalerianoticia] );

$this->form->addFields( [new TLabel('Engalerianoticia')], [$engalerianoticia] );

$add = TButton::create('add', [$this, 'onSaveDetail'], 'Register', 'fa:save');
$this->form->addFields( [], [$add] )->style = 'background: whitesmoke; padding: 5px; margin: 1px;';

$this->detail_list = new BootstrapDatagridWrapper(new TQuickGrid);
$this->detail_list->style = "min-width: 700px; width:100%;margin-bottom: 10px";
$this->detail_list->setId('noticia_list');

// items
$this->detail_list->addQuickColumn('Engalerianoticia', 'engalerianoticia', 'left', 100);

// detail actions
$this->detail_list->addQuickAction( 'Edit', new TDataGridAction([$this, 'onEditDetail']), 'idgalerianoticia', 'fa:edit blue');
$this->detail_list->addQuickAction( 'Delete', new TDataGridAction([$this, 'onDeleteDetail']), 'idgalerianoticia', 'fa:trash red');
$this->detail_list->createModel();

$panel = new TPanelGroup;
$panel->add($this->detail_list);
$panel->getBody()->style = 'overflow-x:auto';
$this->form->addContent( [$panel] );

$btn = $this->form->addAction( 'Save', new TAction([$this, 'onSave']), 'fa:save');
$btn->class = 'btn btn-sm btn-primary';
$this->form->addAction('Clear', new TAction([$this, 'onClear']), 'fa:eraser red');

// create the page container
$container = new TVBox;
$container->style = 'width: 90%';
// $container->add(new TXMLBreadCrumb('menu.xml', __CLASS__));
$container->add($this->form);
parent::add($container);
}
IF

Em vez de usar
  1. <?php $this->detail_list->setId('noticia_list'); ?>


use
  1. <?php $this->detail_list->id 'noticia_list'?>