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.

DataObjectManager Module

Discuss the DataObjectManager module, and the related ImageGallery module.

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

HasManyComplexTableField popup - tickbox problems


Reply

3 Posts   862 Views

Avatar
bones

31 May 2012 at 1:30am Community Member, 104 Posts

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

31 May 2012 at 4:45pm Community Member, 26 Posts

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

2 June 2012 at 12:58am Community Member, 104 Posts

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