7911 Posts in 1354 Topics by 930 members
DataObjectManager Module
SilverStripe Forums » DataObjectManager Module » DOM + ModelAdmin, how?
Discuss the DataObjectManager module, and the related ImageGallery module.
Moderators: martimiz, UncleCheese, Howard, Sean, Ryan M., biapar, Willr, Ingo, swaiba, simon_w
|
Page:
1
|
Go to End | |
| Author | Topic: | 715 Views |
-
DOM + ModelAdmin, how?

3 June 2010 at 11:55pm
hi
can anybody give me some hints or some lines of code where I can see how to use ModelAdmin with DOM?
I have this Object:
class Network extends DataObject {
static $singular_name = "Network";
static $plural_name = "Networks";
static $db = array(
'Name' => 'Varchar',
'Class' => 'Varchar',
);
static $searchable_fields = array(
'Name'
);
static $summary_fields = array(
'Name',
'Class'
);
static $has_many = array(
'Accounts' => 'Account'
);
}I use ModelAdmin like this:
class MyAdmin extends ModelAdmin {
public static $managed_models = array(
'Accout',
Network'
);
static $url_segment = 'Affiliatenetzwerke_und_Accounts';
static $menu_title = 'Affiliatenetzwerke & Accounts verwalten';But now, how or where to implement the DOM, for example that I can add items over DOM interface?
daniel
-
Re: DOM + ModelAdmin, how?

4 June 2010 at 1:43am
You don't have a getCMSFields() function defined in your Network object. You need to define one and put the DOM in there.
-
Re: DOM + ModelAdmin, how?

4 June 2010 at 3:22am Last edited: 4 June 2010 3:23am
hi UC,
i tried this but with no success, I had this in my network object, must something wrong ... because returns:
Error: "Uncaught Exception: Object->__call(): the method 'datafields' does not exist on 'DataObjectManager'" at line 724 of /var/www/xxx/sapphire/core/Object.php
DOM
public function getCMSFields()
{
//$f = parent::getCMSFields();
$f = new DataObjectManager(
$this,
'Accounts',
'Account',
array(
'Name' => 'Name',
'Class'=>'Class'),
'getCMSFields_forPopup'
);
return $f;
}what's wrong here?
daniel
| 715 Views | ||
|
Page:
1
|
Go to Top |

