Jump to:

7939 Posts in 1472 Topics by 944 members

DataObjectManager Module

SilverStripe Forums » DataObjectManager Module » CalendarDateField doesn't work

Discuss the DataObjectManager module, and the related ImageGallery module.

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

Page: 1 2
Go to End
Author Topic: 2310 Views
  • k0m0r
    Avatar
    Community Member
    39 Posts

    CalendarDateField doesn't work Link to this post

    Hi.
    I cannot make CalendarDateField to work with DOM.
    My code is:

    class Item extends DataObject {

    public static $db = array(
    "Date" => "Date",
    );

    function getCMSFields_forPopup() {
    $fields = new FieldSet();
    $fields->push(new CalendarDateField('Date'));
    return $fields;
    }

    }

    class ItemList extends Page {

    function getCMSFields() {
    $fields = parent::getCMSFields();
    $manager = new DataObjectManager(
    $this,
    'Items',
    'Item',
    array(
    "Date" => "Date",
    ),
    null
    );
    $fields->addFieldToTab('Root.Content.Collection',$manager);
    return $fields;
    }

    }

    Every other field in popup works perfect, except I don't get any Date fields, just a simple TextField shows up for 'Date'.
    What am I missing?

  • k0m0r
    Avatar
    Community Member
    39 Posts

    Re: CalendarDateField doesn't work Link to this post

    Just noticed that DatePickerField doesn't work also...

  • UncleCheese
    Avatar
    4085 Posts

    Re: CalendarDateField doesn't work Link to this post

    Version of SS? DOM?

  • kiwiot
    Avatar
    Community Member
    8 Posts

    Re: CalendarDateField doesn't work Link to this post

    I had the same issue with CalendarDateField. Changed the code to DatePickerField and it seems to work fine.

    Alternatively I had CalendarDateField using specifying showcalendar in the setConfig.

    $field = new DateField(....);
    $field->setConfig('showcalendar', true);

    This link has more information on the problem - seems to be a v2.4 issue
    http://www.silverstripe.org/general-questions/show/283185?start=0

  • k0m0r
    Avatar
    Community Member
    39 Posts

    Re: CalendarDateField doesn't work Link to this post

    Hi. Sorry for not responding for so long.
    My SS version is 2.3.7
    Where do I check the DOM version?

    Still can't make it work.

  • k0m0r
    Avatar
    Community Member
    39 Posts

    Re: CalendarDateField doesn't work Link to this post

    Alright, nvm all, I'm an idiot 8]
    The problem was just in front of our eyes:

    $manager = new DataObjectManager(
    $this,
    'Items',
    'Item',
    array(
    "Date" => "Date",
    ),
    null
    'getCMSFields_forPopup'

    );

    Thx all for responding, you can close this.

  • Xurk
    Avatar
    Community Member
    50 Posts

    Re: CalendarDateField doesn't work Link to this post

    I am also having trouble getting the CalendarDateField / DatePickerField to show up in the DataObjectManager pop-ups. The same goes for the DropdownField and SimpleHTMLEditorField. All of them just show up as regular TextareaFields (except for the CalendarDateField, which shows up as a TextField).

    Could this have anything to do with the fact that I'm running version 2.4.0 of Silverstripe? If so, is there any scheduled date for a 2.4.0 release of DataObjectManager? This is a great module, so I'm hoping so

  • UncleCheese
    Avatar
    4085 Posts

    Re: CalendarDateField doesn't work Link to this post

    The trunk has been on 2.4 for a while. For 2.3 versions, see the "2.3 branch" sticky.

    2310 Views
Page: 1 2
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.