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.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

DataObjectManager Module /

Discuss the DataObjectManager module, and the related ImageGallery module.

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

CalendarDateField doesn't work


Go to End


9 Posts   3902 Views

Avatar
k0m0r

Community Member, 39 Posts

13 May 2010 at 10:06pm

Edited: 13/05/2010 10:07pm

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

Community Member, 39 Posts

13 May 2010 at 10:10pm

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

Avatar
UncleCheese

Forum Moderator, 4102 Posts

14 May 2010 at 1:52am

Version of SS? DOM?

Avatar
kiwiot

Community Member, 8 Posts

14 May 2010 at 2:39pm

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

Community Member, 39 Posts

25 May 2010 at 9:19pm

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

Community Member, 39 Posts

25 May 2010 at 9:35pm

Edited: 25/05/2010 9:36pm

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

Community Member, 50 Posts

28 May 2010 at 8:25pm

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

Forum Moderator, 4102 Posts

29 May 2010 at 1:47am

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

Go to Top