25 February 2011 at 6:09am
(Last edited: 25 February 2011 6:10am),
Well, I wouldn't say it was the wrong way, just the DOM way ;-)
Firstly DOM functions are not silverstripe - if they don't work then the only place to ask for help in the section UncleCheese moderates - DataObjectManager. For this reason I do not use it - instead I stick close to the core.
Secondly the silverstripe API HasManyComplexTableField & HasOneComplexTableField (which DOM builds on top) are there to use and I have occasionally added one of these - BUT with your dataobjuects set up correctly - then these are scaffolded for you - why write the code again yourself?
I recommend you drop each one of your getCMSFields function from the data objects and see how ModelAdmin scaffolds it all, then change what you want changed...
25 February 2011 at 8:41am
Thank u so much !!!
This totally changes the way i work with SS. I think i finnaly got it...(well...there will be questions in the future ;) )
Now i understand what you mean with adding fields and pushing them to other tabs.
That Modeladmin thing is great...i used everything at once ( DOM and ModelAdmin ), when in fact the modeladmin does it right.
25 February 2011 at 10:45pm
you are very welcome - ModelAdmin was when I started to like silverstripe alot - since I often build web applications the CRUD of data is very important and important to be able to prototype and get something running as soon as possible - write less code get more functionality - thank you silverstripe!
26 February 2011 at 12:44am
(Last edited: 26 February 2011 12:49am),
sure check this out... http://open.silverstripe.org/ticket/5665
..it has a couple of modeladmin improvements in it, including what you ask for :)
oh and if you want to change the number of results put "$this->setPageSize(15);" in your init (at the end of the dataobject init) - I don't advise putting 999999 into it to show all as this can lead a rather odd looking screen for large numbers of results