Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

General Questions /

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

Error While Export using ComplexTableField


Go to End


1799 Views

Avatar
Dipak

Community Member, 8 Posts

8 April 2009 at 11:34pm

Dear All,

Please help me out, I have ComplexTableField on the fron page and i would like to export all the data from the ComplexTable to csv files, i am able to show data in the ComplexTableField but facing the problem while export, Its redirect me on the home page.
I am working on SilverStripe CMS - 2.3.0-rc1

please find the code below

function ComplexFields() {

$tableField = new ComplexTableField(
$this,
'ContactDetails',
'ContactDetails',
array(
'ID' => 'ContactDetails.ID',
'ContactPerson'=>'Name',
'Email'=>'Email',
'Reason'=> 'Reason',
'PhoneNumber' => 'PhoneNumber',
));

$tableField->setParentClass(false);
$tableField->setShowPagination(true);
if(isset($_REQUEST['printable'])) {
$tableField->setPageSize(false);
} else {
$tableField->setPageSize(5);
}
$tableField->setPermissions(array(
'export',
'delete',
'print'
));
return $tableField;

}

function GetTable()
{
$tableField = $this->ComplexFields();

$fields = new FieldSet(
$tableField);
$actions = new FormAction("", "");

return new Form($this, "ExportForm",$fields,$actions,$validator = null);
}

When I try to delete it gives an error "I can't handle sub-URLs of a MarketingAdmin_Controller object."