Jump to:

5450 Posts in 1672 Topics by 1197 members

Customising the CMS

SilverStripe Forums » Customising the CMS » File Upload Field in ManyManyComplexTableField popup

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

Page: 1 2 3
Go to End
Author Topic: 3549 Views
  • kevino
    Avatar
    Community Member
    30 Posts

    Re: File Upload Field in ManyManyComplexTableField popup Link to this post

    How does the DOM store it's data compared to the CTF?

    Does it work in exactly the same way, so that I can just swap out DOM for CTF and keep all the data and relationships in tact?
    The option to reorder entries looks like a real bonus, as that seems to be the biggest flaw with the CTF..

  • Aram
    Avatar
    Community Member
    598 Posts

    Re: File Upload Field in ManyManyComplexTableField popup Link to this post

    Yep, the DOM is just an extention of the CTF class. It pulls in the same data (i.e. DataObjects) and displays them in the same way just adding a new skin, more functionality and a much faster popup window. Honestly I don't think I could go back to a CTF now, it would just seem so.......windows 98!

  • yurigoul
    Avatar
    Community Member
    202 Posts

    Re: File Upload Field in ManyManyComplexTableField popup Link to this post

    I copied the code here after creating my own code from scratch to try and correct an error. The problem is this: When using a FileIFrameField or ImageField I always get the the same message instead of FileIFrameField or ImageField in the popup:

    'You can add files once you have saved for the first time.'

    I can then save the record in the popup, close it, reopen the record for editing and THEN I can add a file.

    I know where this comes from, it has to do with line 14 in sapphire/forms/FileIFrameField.php:

    $data = $this->form->getRecord(); // returns no data

    Somebody know what I can do about this? (Creating a mysite/forms/MyFileIFrame.php class for instance, but am not sure what to change or add)

    EDIT: tested it on 2.3.3 and 2.3.4

  • Aram
    Avatar
    Community Member
    598 Posts

    Re: File Upload Field in ManyManyComplexTableField popup Link to this post

    I don't think you can do anyuthing, this comes from the fact that before you save it the DataObject has no ID so it cannot have relationships like attaching an image. However when using DOM it should refresh when pressing save so that you can add the image strait away without having to open the popup again.

    Aram

  • yurigoul
    Avatar
    Community Member
    202 Posts

    Re: File Upload Field in ManyManyComplexTableField popup Link to this post

    Thanks for the reply - I will look into using DOM.

    3549 Views
Page: 1 2 3
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.