I know it is not only me having this problem, but no one can tell me how to fix this. I have a dropdownfield and want to save an id with it. After submit, the id is stored in the database and the dropdown shows the selected value. But after requesting the form from the sitetree again, the dropdown shows the first value, in my case "Please choose".
Example of my source (Location extends DataObject):
public static $has_one = array(
"MeetingPoint" => "Location"
);
public function getCMSFields() {
$fields = parent::getCMSFields();
// create or find tabs
$fields->findOrMakeTab( "Root.Content.Locations" );
$meetingPoint = new DropdownField( "MeetingPoint", "Meeting Point", DataObject::get( "Location" )->toDropDownMap( "ID", "Name", "Please choose" ) );
$fields->addFieldToTab( "Root.Content.Locations", $meetingPoint );
return $fields;
}
function onBeforeWrite()
{
$this->MeetingPointID = $this->MeetingPoint;
parent::onBeforeWrite();
}
Is this an official bug?