Hi,
I'm working on a SilverStripe 3.1.8 site. I have a DataExtension that defines some fields, and I'm trying to use Display Logic to modify the behavior of the CMS:
private static $db = array(
'Enabled' => 'Boolean',
'Title' => 'Text'
);
private static $has_one = array(
'Link' => 'SiteTree',
'Image' => 'Image'
);
public function updateCMSFields(FieldList $fields) {
$fields->addFieldsToTab('Root.Other', array(
CheckboxField::create('Enabled'),
TextField::create('Title', "Title")->displayIf('Enabled')->isChecked()->end(),
TreeDropdownField::create("LinkID", "Linked page", 'SiteTree')->displayIf('Enabled')->isChecked()->end(),
UploadField::create('Image', "Image")->displayIf('Enabled')->isChecked()->end()
));
}
When I check or uncheck the "Enabled" checkbox, the other three fields should appear or disappear correspondingly. Unfortunately, only the TextField does, the TreeDropdownField and UploadField are always shown.
Any ideas why Display Logic fails with these two field types, and how to solve it?
Thank you!