Jump to:

7938 Posts in 1541 Topics by 945 members

DataObjectManager Module

SilverStripe Forums » DataObjectManager Module » setEmptyString and nested DOM

Discuss the DataObjectManager module, and the related ImageGallery module.

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

Page: 1
Go to End
Author Topic: 825 Views
  • patte
    Avatar
    Community Member
    63 Posts

    setEmptyString and nested DOM Link to this post

    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;
       }

  • UncleCheese
    Avatar
    4085 Posts

    Re: setEmptyString and nested DOM Link to this post

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

    825 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.