Jump to:

5450 Posts in 1672 Topics by 1197 members

Customising the CMS

SilverStripe Forums » Customising the CMS » SS3 ModelAdmin - Display blank form after create

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

Page: 1
Go to End
Author Topic: 284 Views
  • pbz
    Avatar
    Community Member
    5 Posts

    SS3 ModelAdmin - Display blank form after create Link to this post

    I'm using ModelAdmin with the default form scaffolding, to manage a complicated database of related objects.

    Something along the line of Company has_many Employees, each Employee has_many Notes.

    When creating Notes, after clicking the Create button a nice little "Saved" message appears and the user remains on the edit form for the just created Note.

    Is there a way it can be setup so the user is either taken to a blank "Create" form or the GridField listing of all Notes for that Employee after Creating a Note? This could save a lot of clicks for a user creating many Notes in a row for one Employee?

    Thanks.

  • martimiz
    Avatar
    Forum Moderator
    1035 Posts

    Re: SS3 ModelAdmin - Display blank form after create Link to this post

    I don't think there is, at the moment. The GridFieldDetailForm::doSave() redirects including the new ID, so the form will interprete it as an edit request.

    It should be possible to subclass the GridFieldDetailForm and its Link() method to leave out the ID based on some condition. Then make sure the the subclass is used in the GridField

    Martine

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