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

setEmptyString and nested DOM


Reply

2 Posts   838 Views

Avatar
patte

2 July 2010 at 11:18pm (Last edited: 2 July 2010 11:21pm), Community Member, 63 Posts

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

3 July 2010 at 2:06am 4085 Posts

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