17488 Posts in 4473 Topics by 1978 members
|Go to End|
24 September 2008 at 7:28am
Why is setAddTitle() only available in extensions of ComplexTableField and not in just a plain CTF? Was this an oversight? Seems odd.
Anyone have a workaround?
24 September 2008 at 9:49pm
If by extension you mean subclass then it's not odd. it's because subclass is supposed to have all the features that superclass has plus extra feature(s).
For some reasons, if you want only the functionality provided by ctf and only setAddTitle() function, you have to subclass ctf and add this function to the subclass. Also make sure you define a variable to hold addTitle and set the $template variable to a new template that you'll create to display addTitle.
25 September 2008 at 12:43am Last edited: 25 September 2008 12:45am
I see. Still seems like an odd design choice, though. I understand what you mean by "extra features," but all of the immediate subclasses of CTF has this feature. Save some code and just put that feature in the class above it, you know?
And it's more than just adding a function. Now i have to go into the CTF template and make it aware of my addTitle variable for the add button.
25 September 2008 at 1:04am
Just out of curiosity, why you don't use subclasses of ctf instead when they're providing the feature that you need.
My suggestion earlier is not a good practice. you might wanna look at the code more closely to whether ctf class really doesn't allow us to do so.
25 September 2008 at 1:18am
The subclasses of CTF are HasManyCTF and HasOneCTF... I just need a plain ol' CTF!
|Go to Top|