Jump to:

2011 Posts in 1436 Topics by 620 members

Form Questions

SilverStripe Forums » Form Questions » ComplexTableField on Front End

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

Page: 1
Go to End
Author Topic: 1043 Views
  • Jnauta
    Avatar
    Community Member
    8 Posts

    ComplexTableField on Front End Link to this post

    I have created several dataobjects that ia wish users to edit from the front end. I can get the ComplexTableField to display the list of DataObjects associated with the user's account, however I can not get the front end forms to allow adding and editing. Any Thoughts?

    Controller

    public function libraryDocuments()
    {
    $fdo = new ComplexTableField(
    $this,
    'MyDocs',
    'LibarayItem',
    '',
    'CustomCMSFields_forPopup'
    );
    $fdo->setParentClass(false);

    $fields = new FieldSet(array(
    new HiddenField('ID', ''),
    $fdo,
    ));

    $actions = new FieldSet(array(
    new FormAction ('saveLibraryDocs','Save'),
    ));

    //$actions = new FieldSet();

    return new Form($this, 'libraryDocuments', $fields, $actions);
    }

  • zenmonkey
    Avatar
    Community Member
    528 Posts

    Re: ComplexTableField on Front End Link to this post

    Off the top of my head, I'd say the Page_Controller doesn't have access to those controllers. I know I've used ComplexTableFields in the front end, but I've always removed those functions. Have you tried specifically setting the permissions?

    http://api.silverstripe.org/2.4/forms/fields-relational/ComplexTableField.html#var$permissions

  • Jnauta
    Avatar
    Community Member
    8 Posts

    Re: ComplexTableField on Front End Link to this post

    I was able to get this working, it was a simple permissions issue on the dataobject. I neeted to implment PermissionsProvider and add the can(?) Access to the dataobject in question.

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