7912 Posts in 1355 Topics by 930 members
DataObjectManager Module
SilverStripe Forums » DataObjectManager Module » HasManyDataObjectManager no CSS
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: | 342 Views |
-
HasManyDataObjectManager no CSS

27 September 2012 at 1:31am
Hi,
I have simple datamodel with one dataobject having has_many relation to other dataobject, and back reference using has_one. Problem is in CMS I get popup tab shown without CSS. Trying to view related object also shows in popup without any css.
How to resolve this? I'm using DataObjectManager build from 2012-05-29 (still on SS 2.4).
-
Re: HasManyDataObjectManager no CSS

27 September 2012 at 2:56am
I noticed that I need to have all relations connect using DataObjectManager objects. If I use only some, it breaks it up.
Furthermore, nested DataObjectManager isn't working properly. Second popup shows below already showing popup.
What might be the problem here?

-
Re: HasManyDataObjectManager no CSS

16 October 2012 at 3:53pm
You can't use TabSets in a DOM popup.
---------------
Silverstripe tips, tutorials, screencasts, and more. http://www.leftandmain.com -
Re: HasManyDataObjectManager no CSS

16 October 2012 at 10:29pm
Hi UC,
I've tried removing TabSets, but unfortunately it didn't help. Relevant code is as follows:
class Article extends DataObject {
public static $has_many = array(
'Reviews' => 'Review'
);function getCMSFields() {
$f = parent::getCMSFields();
$revManager = new HasManyDataObjectManager(
$this,
'Reviews',
'Review'
);
$f->addFieldToTab('Root.Reviews', $revManager);
return $f;
}class Review extends DataObject{
public static $has_one = array(
'Article' => 'Article',
'Owner' => 'Member'
);
public static $has_many = array(
'Comments' => 'Comment'
);
function getCMSFields() {
$f = new FieldSet();
$manager = new DataObjectManager(
$this, // Controller
'Comments', // Source name
'Comment', // Source class
);
$f->push($manager);
return $f;
}
}class Comment extends DataObject {
static $has_one = array(
'Review'=>'Review',
);
public function getCMSFields() {
return new FieldSet(
new TextareaField('Content', 'Content'),
new CheckboxField('Status', 'Status'),
new FileIFrameField('ReviewReport','Review file')
);
}
}It's pretty straightforward model, but I can't figure out why it isn't working. Any ideas?
| 342 Views | ||
|
Page:
1
|
Go to Top |

