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

setEmptyString and nested DOM


Go to End


2 Posts   1730 Views

Avatar
patte

Community Member, 63 Posts

2 July 2010 at 11:18pm

Edited: 02/07/2010 11:21pm

Hi,

using nested DOM with SimpleTreeDropdownField the setEmptyString is not working anymore...

Can someone please enlighten me whats wrong with my code??

Thanks much in advance

patte ;-)

	function getCMSFields()
	{
	return new FieldSet(
		$dropdown = new SimpleTreeDropdownField("MyUrlID", "Bitte waehlen Sie das Ziel aus", "SiteTree"),
		new TextField('Ueberschrift'),
		new SimpleWysiwygField('Beschreibung'),
		new ImageField('Bild'),
		new FileDataObjectManager(
			$this,
			'Downloads',
			'Download',
			'Attachment',
			array('Name' => 'Name','Description' => 'Description')
			)		
		);
	$dropdown->setEmptyString('-- Please select --');
	}

UPDATE: sorry guys, problems resolved

	function getCMSFields()
	{
	$f = new FieldSet(
		$dropdown = new SimpleTreeDropdownField("MyUrlID", "Bitte waehlen Sie das Ziel aus", "SiteTree"),
		new TextField('Ueberschrift'),
		new SimpleWysiwygField('Beschreibung'),
		new ImageField('Bild'),
		new FileDataObjectManager(
			$this,
			'Downloads',
			'Download',
			'Attachment',
			array('Name' => 'Name','Description' => 'Description')
			)		
		);
		$dropdown->setEmptyString('-- Please select --');
		return $f;
	}

Avatar
UncleCheese

Forum Moderator, 4102 Posts

3 July 2010 at 2:06am

Please note that the OP was returning a value before the setEmptyString() method, so it was never executed.