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   892 Views

Avatar
patte

Community Member, 63 Posts

12 March 2010 at 5:19am

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

Forum Moderator, 4094 Posts

12 March 2010 at 5:30am

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

Avatar
patte

Community Member, 63 Posts

12 March 2010 at 5:42am

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

Forum Moderator, 4094 Posts

12 March 2010 at 6:03am

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

Avatar
patte

Community Member, 63 Posts

12 March 2010 at 10:14pm

UncleCheese, you`re the best! Thanks much