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.

DataObjectManager Module /

Discuss the DataObjectManager module, and the related ImageGallery module.

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

HasManyComplexTableField popup - tickbox problems


Go to End


3 Posts   1977 Views

Avatar
bones

Community Member, 110 Posts

31 May 2012 at 1:30am

We're using HasManyComplexTableField to add items to a banner. The banner is used on multiple pages, and we've found that when we add something on one page, it also appears on the others (which is great) but with the tick boxes greyed-out so we can't enable that item on other pages (only on the original page).

Can anybody either help us to "enable" the checkboxes on all pages, or have them ticked by default (we're happy for the same content to appear on each page).

Thanks.

Avatar
Plato Creative

Community Member, 26 Posts

31 May 2012 at 4:45pm

You have the wrong kind of relation set on your data objects.

The reverse of a has_many is a has_one. As each of your banners can only have one page, they are greyed out so that you cannot select them on other pages once they've already been associated to a page.

HasManyComplexTableField is largely redundant (along with HasOneComplexTableField), you can just use ComplexTableField and it'll automatically take care of things for you (as by default CTF's are made for handling many related items).

However what you're actually wanting by the sounds of it is a many_many relation, to which the reverse is belongs_many_many on your banners. This way you can have one banner on many pages, with each page having many banners (not necessarily the same ones).

Avatar
bones

Community Member, 110 Posts

2 June 2012 at 12:58am

Yes, that's fixed it. $many_many_thanks for your help ;)