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

SimpleTreeDropdownField optional?


Reply

5 Posts   868 Views

Avatar
patte

12 March 2010 at 5:19am Community Member, 63 Posts

Hi,

I am using SimpleTreeDropdownField within DOM.

Is there a way not to select a page? I want to make the selection optional but the homepage is alway selected per default.

Thanks much

patte

Avatar
UncleCheese

12 March 2010 at 5:30am 4085 Posts

$myDropdown->setEmptyString('-- Please select --');

Avatar
patte

12 March 2010 at 5:42am Community Member, 63 Posts

Thanks for your help UncleCheese :-)

Can you please give me another hint where to place setEmptyString?

public function getCMSFields_forPopup()
   {
      return new FieldSet(
         new SimpleTreeDropdownField("MyUrlID", "Bitte waehlen Sie das Ziel aus", "SiteTree")
      );
   }

Avatar
UncleCheese

12 March 2010 at 6:03am 4085 Posts

public function getCMSFields_forPopup()
{
$f = new FieldSet(
$dropdown = new SimpleTreeDropdownField("MyUrlID", "Bitte waehlen Sie das Ziel aus", "SiteTree")
);
$dropdown->setEmptyString(...);
return $f;
}

Avatar
patte

12 March 2010 at 10:14pm Community Member, 63 Posts

UncleCheese, you`re the best! Thanks much