Suppose I have the code below... when I add 'ObjectWithOne' to 'ObjectWithMany' using ModelAdmin the new item doesn't appear in the this list. I need to hit search again, then re-select the 'ObjectWithMany' i created the 'ObjectWithOne' for. This also is an issue when I edit one of the items - it doesn't update the list upon closing the popup...
...is there anything someone can help me with to get this fixed please?
<?php
class HasManyAdmin extends ModelAdmin
{
static $managed_models = array(
'ObjectWithMany',
);
static $url_segment = 'hasmanyadmin';
static $menu_title = 'HasManyAdmin';
}
class ObjectWithMany extends DataObject
{
static $db = array(
'Name' => 'Text',
);
static $has_many = array(
'ObjectWithOne' => 'ObjectWithOne',
);
}
class ObjectWithOne extends DataObject
{
static $db = array(
'Name' => 'Text',
);
static $has_one = array(
'ObjectWithMany' => 'ObjectWithMany',
);
}