Hi
I created some page decoration that one of its field is other page.
I use the DropdownField to allow the selection of the page. The problem is that the DropdownField indeed display the pages, but it does not save the selected one.
class MyDecorator extends DataObjectDecorator {
function extraStatics() {
return array(
'db' => array(
"AAA" => "Varchar(255)",
),
'has_one' => array(
"MyPage" => "Page",
),
);
}
public function updateCMSFields(FieldSet &$fields) {
$fields->addFieldToTab("Root.Content.PageHolder", new TextField("AAA", "My AAA", "default"));
$fields->addFieldToTab("Root.Content.PageHolder", new DropdownField('MyPage', 'My Page', Dataobject::get("Page")->toDropdownMap('ID','Title','[From Parent]')));
}
...
}
The AAA (which I just add for test if it works) is saved as it should.
In The MyPage the list of the pages is display correctly, but the selected value isnt saved).
any ideas,
Thanks
Rotem.