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.

Form Questions /

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

Nested Fieldsets


Go to End


1470 Views

Avatar
mishell

Community Member, 19 Posts

6 August 2011 at 4:33am

Edited: 06/08/2011 4:34am

I have to nest a fieldsets, or something simmilar. Now I use

$fields = new FieldSet;
$fields->push($PosName = new CompositeField());

foreach($objects as $row)
{
     $PosName->push(new FileUploadField('Dupa'.$i++,array(),$this));
}

Only problem is that FileUploadField does not work in that configuration returning HTTTP ERROR.

If I Use

 $fields->push(new FileUploadField(...)); 

it works perfectly. But I have to make many instances of FUF. The reason I need nested composite fields is what I need data object set shown with fields and transposed.

ITEM      | A | B
COL       | 1 | 2
COL2     | 1 | 2 
UPLOAD | 1 | 2 

It there any solution to this problem? I am fighting all day with this.

Thanks in advance
Michael.