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.

DataObjectManager Module

Discuss the DataObjectManager module, and the related ImageGallery module.

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

CalendarDateField doesn't work


Go to End
Reply

9 Posts   2473 Views

Avatar
k0m0r

13 May 2010 at 10:06pm (Last edited: 13 May 2010 10:07pm), Community Member, 39 Posts

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?

Avatar
k0m0r

13 May 2010 at 10:10pm Community Member, 39 Posts

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

Avatar
UncleCheese

14 May 2010 at 1:52am 4085 Posts

Version of SS? DOM?

Avatar
kiwiot

14 May 2010 at 2:39pm Community Member, 8 Posts

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

Avatar
k0m0r

25 May 2010 at 9:19pm Community Member, 39 Posts

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.

Avatar
k0m0r

25 May 2010 at 9:35pm (Last edited: 25 May 2010 9:36pm), Community Member, 39 Posts

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.

Avatar
Xurk

28 May 2010 at 8:25pm Community Member, 50 Posts

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 :)

Avatar
UncleCheese

29 May 2010 at 1:47am 4085 Posts

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

Go to Top