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

Managing cascaded relations


Go to End


4 Posts   1485 Views

Avatar
smares

Community Member, 25 Posts

31 December 2011 at 3:12am

Hey guys, I am having some trouble with the following setup: Custom page that has several objects via a has_many relation. The objects on the other hand are related to a third object via a has_one relation. How would I handle this in the CMS as apparently it's not possible to open a popup within a popup. The page's getCMSFields has a HasManyComplexTableField that allows me to add data objects to the page, but how can I add data objects to the data objects as the HasOneComplexTableField I tried using in the first data object lacks the Add link in the popup (actually it's there in the markup, but it's set to hidden via CSS).

Avatar
swaiba

Forum Moderator, 1899 Posts

1 January 2012 at 11:58pm

I know this is possible with ModelAdmin, but have no idea for editting a Page. Do you have...

$hasOneCTF->setPermissions(array('edit','show','add'));

...before you "addFieldToTab"?

Avatar
smares

Community Member, 25 Posts

2 January 2012 at 10:27pm

Yep, but it doesn't work. I think popup within a popup is not supported. :-/

Avatar
martimiz

Forum Moderator, 1391 Posts

3 January 2012 at 1:24am

No, a popup within a popup won't work afaik, you can see the summary, but you can't edit/add anything. Could ajshort's HasOnePickerField maybe be used in this situation? https://github.com/ajshort/silverstripe-itemsetfield/