Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

Customising the CMS

Checkbox in CMS


4 Posts   379 Views


16 July 2013 at 12:54am (Last edited: 16 July 2013 12:55am), Community Member, 4 Posts


this is my first post in SS forums. I'm quite new programmer and for SS as well.
I'm building my first web and i have some troubles with checkbox field. Everything looks good, but the problem is in CMS. If i check the value "DominaKeitimas" and do "save and publish" everything works except checkbox field in CMS. Somehow CMS do not save checked value in CMS, but in database and web it works perfectly. Search gives me everything i need and dataobject as well. So my question is: what did i do wrong and how to solute this issue?

some code...
class NTObjektas extends Page{
static $db = array( 'DominaKeitimas' => 'Boolean');
public static $has_one = array("Objects" =>"Object");
public function getCMSFields() {
$fields = parent::getCMSFields();
$fields->addFieldToTab('Root.Info', new CheckboxField('DominaKeitimas', 'Domina keitimas', 1));
/* some code */
return $fields;
class NTObjektas_Controller extends Page_Controller{

p.s. sorry for my broken english.


16 July 2013 at 3:28am Community Member, 528 Posts

You're setting the value on the field which is overriding the set value on the CMS

$fields->addFieldToTab('Root.Info', new CheckboxField('DominaKeitimas', 'Domina keitimas', 1));
$fields->addFieldToTab('Root.Info', new CheckboxField('DominaKeitimas', 'Domina keitimas'));


16 July 2013 at 4:13am (Last edited: 16 July 2013 4:14am), Community Member, 4 Posts

sorry, but its not working....
and i don't know why... there are some problems with DropdownField...

$veiksmoTipas = new DropdownField('VeiksmoTipas', 'some text', array(
'Siulome' => 'Siūlome',
'Ieskome' => 'Ieškome',
'Vystomi' => 'Vystomi Objektai'
this one works perfectly, but another is the same problem as with the checkbox field....

$sandorioTipas = new DropdownField('SandorioTipas', 'some text', array(
'Nuoma' => 'Nuoma',
'Pardavimas' => 'Pardavimas'

$fields->addFieldToTab('Root.Info', $sandorioTipas);

values in the web and database are shown, but in CMS didn't saved.... strange


19 July 2013 at 8:30pm Community Member, 4 Posts


i don't know what was wrong, but i changet my Variables names and all the things keep working :)