Uncle Cheese's wonderful SS3.1 module silverstripe-gridfield-betterbuttons which furnishes "Save" "Save And..." and "Delete" still suffers from the confounding Silverstripe perplexity of the fact that you have to save the record first to make those buttons appear.
The purists will have it that until then the record does not exist. However to the average user, just uploading the image IS the record, nothing more, so a double action is illogical and unnecessary.
I decided that I would save the new image object the moment the upload field is instantiated. The fact that I will get left with empty object if the process is abandoned is far less confusing that the alternative.
This is from my SlideImage.php class which has a has_many on all page types (from Page.php)
$imageField = new UploadField('Image','Choose Images');
$imageField->setFolderName('Uploads/orbit-slider');
$imageField->setRecord($this);
$this->write();
The snag is that it doesn't work. It looks as though it's going to, but the write() makes the object vanish and then I get the classic can't handle suburls in the upload chooser when I choose from files.
So how does one do a an "autosave" properly upon instantiation of this form without the user knowing? It must be possible and I am sure many would want this. However this is where the form objects get very confusing and I need someone of Uncle Cheese's calibre to guide me!
Simple, effective and probably contrary to all the purists thinking but it means that the Uncle Cheese buttons "Save", "Save And..." and "Delete" appear immediately which is what Mr and Mrs Editor will expect.
Hope this helps