Jump to:

5516 Posts in 1734 Topics by 1221 members

Customising the CMS

SilverStripe Forums » Customising the CMS » Usage of ComplexTable when subclassing LeftAndMain?

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

Page: 1
Go to End
Author Topic: 1059 Views
  • aimcom
    Avatar
    Community Member
    8 Posts

    Usage of ComplexTable when subclassing LeftAndMain? Link to this post

    At the moment, I'm trying to program a new backend module. For this purpose, I subclassed LeftAndMain and created several different DataObjects. This all works quite well, except for one issue: I can use simple fields like TextField oder EmailField without any problems, but a ComplexTableField doesn't work. The table field itself is displayed correctly, but when trying to add a new object, a popup is opened and this error message is shown:
    [User Error] Uncaught SS_HTTPResponse_Exception: I can't handle sub-URLs of a Form object. GET /admin/my_module/EditForm/field/Paragraphs/add
    Line 305 in /srv/www/htdocs/xyz/silverstripe-v2.4.0/sapphire/core/control/RequestHandler.php

    I tried to overwrite EditForm() and getEditForm(), but haven't found a solution so far. It would be nice if somebody could give me a hint.

  • Apophenian
    Avatar
    Community Member
    46 Posts

    Re: Usage of ComplexTable when subclassing LeftAndMain? Link to this post

    Did you have any luck with this? I am having a similar problem.

  • Apophenian
    Avatar
    Community Member
    46 Posts

    Re: Usage of ComplexTable when subclassing LeftAndMain? Link to this post

    Actually, I managed to resolve this after all - it's a bit of a hack, but it works.

    I subclassed TableListField (ComplexTableField in your case), and in my subclass, I created a method Link() that pointed to the url of my custom admin area eg

    function Link(){
    return Director::absoluteBaseURL() . 'admin/<url of my custom admin>/';
    }

    Hopefully this works for you.

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