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.

All other Modules /

Discuss all other Modules here.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Model admin values for fields not appearing




Community Member, 5 Posts

8 June 2009 at 6:19am

I am trying to set the default values for a new record managed by model admin. I've overridden the getCMSAddFormFields in the class Podcast extends DataObject. it works fine for generating the field, but in the ReadonlyField has a value of (none) when the add button is pressed in the model admin.

I'm still new to this, and don't fully understand the distinction between the model code, and the controller code, but I have a feeling that this is solved by a controller... but can extensions of dataobject even have controllers?

Please Help!!

public function getCMSAddFormFields() {
      return new FieldSet(
         new ReadonlyField(
          $name = "Date",
          $title = "Select a date",
          $value = date("d/m/Y")

         new TextField('Name'),
         new TextareaField('Description')