7913 Posts in 1355 Topics by 930 members
DataObjectManager Module
SilverStripe Forums » DataObjectManager Module » Managing two subclasses in one DOM?
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: | 973 Views |
-
Managing two subclasses in one DOM?

16 April 2010 at 12:40am
Hi.
Is DOM capable of managing two subclasses at once, both extending the same DataObject that is passed to DOM as a $sourceClass param?
For example, I have a DataObject called Box with two subclasses: SwfBox and ImageBox.
I would like to use DOM to add Boxes of both types, one containing SWF files and another one with images, to the same DataObjectSet.
So what I need to have are two separate 'Add new' buttons, each for one subclass, and of course support for two different getCMSFields_forPopup() functions.
Is there any way to achieve this in DOM? -
Re: Managing two subclasses in one DOM?

16 April 2010 at 1:35am
Shouldn't be a problem. Is it not working?
-
Re: Managing two subclasses in one DOM?

16 April 2010 at 2:01am
Errr... I tried to find any docs about that and failed.
I have a DOM field constructed like this:$manager = new DataObjectManager(
$this,
'BoxManager',
'Box',
array(
"Title" => "Title",
),
'getCMSFields_forPopup'
);
$fields->addFieldToTab('Root.Content.BoxManager', $manager);and two subclasses of the class 'Box': SwfBox and ImageBox.
What do I need to change if I want to add SwfBoxes and ImageBoxes in the same instance of DOM?
-
Re: Managing two subclasses in one DOM?

16 April 2010 at 2:37am
Oh, no, you can't manage two classes in the same DOM. Has to be two separate instances.
-
Re: Managing two subclasses in one DOM?

4 September 2010 at 10:44pm
I searching solution for this too. Maybe who have ideas how make this work easly?
-
Re: Managing two subclasses in one DOM?

14 January 2012 at 5:58pm
Here's my solution http://pitchandtone.co.nz/post/15812415474/inheritance-dataobjectmanager
| 973 Views | ||
|
Page:
1
|
Go to Top |


