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   883 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, 4096 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.