I'm aslo having trouble adding an ImageDOM to the model admin.
On my DataObject I have :
static $has_many = array (
"FrontWeb_Image" => "InventoryImage"
);
...
function getCMSFields()
{
$fields = parent::getCMSFields();
//Main Tab
$frontWebManager = new ImageDataObjectManager(
$this, // Controller
'FrontWeb_Image', // Source name
'InventoryImage', // Source class
'Attachment', // File name on DataObject
array(
), // Headings
'getCMSFields_forPopup' // Detail fields (function name or FieldSet object)
// Filter clause
// Sort clause
// Join clause
);
$fields->addFieldToTab("Root.Main", $frontWebManager);
return $fields;
}
The Image DataObject look like this
class InventoryImage extends DataObject {
static $has_one = array (
'BaciItem' => 'BaciItem',
'Attachment' => 'File'
);
public function getCMSFields_forPopup()
{
return new FieldSet(
new FileIFrameField('Attachment')
);
}
}
where BaciItem is the name of the First DataObject;
The ImageDOM appears on the ModelAdmin edit form, however, when I try to add an Inventory Image I have the standard dropdown for import from existing folder however when I select a folder I get another ImageDOM instead of the file list.
Perhaps some background will help. I'm trying to create an Inventory System. Each BaciItem has info related to it Description UPC etc, but it also needs to have a multiple images associated with it (back, front etc). realistically it will only ever have one of each, so I was planning on using multiple ImageDOMs, one of each image type.
Thanks