7913 Posts in 1355 Topics by 930 members
DataObjectManager Module
SilverStripe Forums » DataObjectManager Module » setEmptyString and nested DOM
Discuss the DataObjectManager module, and the related ImageGallery module.
Moderators: martimiz, UncleCheese, Howard, Sean, Ryan M., biapar, Willr, Ingo, swaiba, simon_w
|
Page:
1
|
Go to End | |
| Author | Topic: | 640 Views |
-
setEmptyString and nested DOM

2 July 2010 at 11:18pm Last edited: 2 July 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;
} -
Re: setEmptyString and nested DOM

3 July 2010 at 2:06am
Please note that the OP was returning a value before the setEmptyString() method, so it was never executed.
| 640 Views | ||
|
Page:
1
|
Go to Top |

