Jump to:

3448 Posts in 1062 Topics by 738 members

Data Model Questions

SilverStripe Forums » Data Model Questions » How to limit user selection in ManyManyComplexTableFiled

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

Page: 1
Go to End
Author Topic: 895 Views
  • Ben_W
    Community Member
    80 Posts

    How to limit user selection in ManyManyComplexTableFiled Link to this post

    I have the following ManyManyComplexTableField, which basically form a many to many relationship that allows user to pick number of pages as recommended reading for a given page. Is there a way I can enforce a business rule into this, say user may not select more than 5 pages as recommended reading. Need a way to disable the checkbox I would thought. Any pointer would be deeply appreciated. Cheers.

    $tablefield = new ManyManyComplexTableField(
          'Title' => 'Page Name',
          'BoldIntroduction' => 'Bold Introduction'
        "SiteTree.ID != $this->ID AND SiteTree.ParentID=$this->ParentID",


    $fields->addFieldToTab( 'Root.Content.FurtherReadings', $tablefield );

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.