Jump to:

23490 Posts in 18996 Topics by 2878 members

General Questions

SilverStripe Forums » General Questions » Managing cascaded relations

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

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

Page: 1
Go to End
Author Topic: 537 Views
  • smares
    Avatar
    Community Member
    25 Posts

    Managing cascaded relations Link to this post

    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).

  • swaiba
    Avatar
    Forum Moderator
    1792 Posts

    Re: Managing cascaded relations Link to this post

    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"?

  • smares
    Avatar
    Community Member
    25 Posts

    Re: Managing cascaded relations Link to this post

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

  • martimiz
    Avatar
    Forum Moderator
    1086 Posts

    Re: Managing cascaded relations Link to this post

    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/

    537 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.