Hi,
I've into a class extends LeftAndMain
....
function getEditForm() {
$editor = new ComplexTableField(
$this,
'ContactFormSubmissions',
'ContactFormSubmission',
array('Name','Surname'),
);
$editor->setParentClass(false);
$myTableField= ...
$fields= new FieldSet($myTableField,$editor);
$actions = new FieldSet(
new FormAction('doSaveLink', 'Salva')
);
$form = new Form($this, "EditForm", $fields, $actions,null);
return $form;
}
function ContactFormSubmissions() {
return DataObject::get('ContactFormSubmission');
}
}
but at runtime I've thie error:
[Notice] Array to string conversion
Trace
* strpos(Array,()
Line 268 of ViewableData.php
* ViewableData->castingClass(0)
Line 374 of ViewableData.php
* ViewableData->obj(0,,,)
Line 446 of ViewableData.php
* ViewableData->XML_val(0)
Line 1341 of TableListField.php
* TableListField_Item->Fields()
Line 369 of ViewableData.php
* ViewableData->obj(Fields)
Line 589 of .cacheC..xampp.htdocs.ss242.sapphire.templates.ComplexTableField.ss
* include(C:\Windows\Temp\silverstripe-cacheC--xampp-htdocs-ss242\.cacheC..xampp.htdocs.ss242.sapphire.templates.ComplexTableField.ss)
Line 420 of SSViewer.php
* SSViewer->process(ComplexTableField)
Line 342 of ViewableData.php
* ViewableData->renderWith(ComplexTableField)
Line 275 of ComplexTableField.php
* ComplexTableField->FieldHolder()
Line 369 of ViewableData.php
* ViewableData->obj(FieldHolder,,,1)
Line 446 of ViewableData.php
* ViewableData->XML_val(FieldHolder,,1)
Line 77 of .cacheC..xampp.htdocs.ss242.sapphire.templates.Includes.Form.ss
* include(C:\Windows\Temp\silverstripe-cacheC--xampp-htdocs-ss242\.cacheC..xampp.htdocs.ss242.sapphire.templates.Includes.Form.ss)
Line 420 of SSViewer.php
* SSViewer->process(Form)
Line 342 of ViewableData.php
* ViewableData->renderWith(Array)
Line 1085 of Form.php
* Form->forTemplate()
Line 447 of ViewableData.php
* ViewableData->XML_val(EditForm,,1)
Line 12 of .cacheC..xampp.htdocs.ss242.mysite.code.templates.DispoAdmin_right.ss
* include(C:\Windows\Temp\silverstripe-cacheC--xampp-htdocs-ss242\.cacheC..xampp.htdocs.ss242.mysite.code.templates.DispoAdmin_right.ss)
Line 420 of SSViewer.php
* SSViewer->process(DispoAdmin)
Line 342 of ViewableData.php
* ViewableData->renderWith(Array)
Line 485 of LeftAndMain.php
* LeftAndMain->Right()
Line 369 of ViewableData.php
* ViewableData->obj(Right,,,1)
Line 446 of ViewableData.php
* ViewableData->XML_val(Right,,1)
Line 71 of .cacheC..xampp.htdocs.ss242.cms.templates.LeftAndMain.ss
* include(C:\Windows\Temp\silverstripe-cacheC--xampp-htdocs-ss242\.cacheC..xampp.htdocs.ss242.cms.templates.LeftAndMain.ss)
Line 420 of SSViewer.php
* SSViewer->process(DispoAdmin)
Line 202 of Controller.php
* Controller->handleAction(SS_HTTPRequest)
Line 137 of RequestHandler.php
* RequestHandler->handleRequest(SS_HTTPRequest)
Line 147 of Controller.php
* Controller->handleRequest(SS_HTTPRequest)
Line 281 of Director.php
Why? Thank you