Jump to:

17452 Posts in 4473 Topics by 1971 members

Archive

SilverStripe Forums » Archive » Dropdownfield doesn't seem to work inside getCMSFields_Popup

Our old forums are still available as a read-only archive.

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

Page: 1
Go to End
Author Topic: 1366 Views
  • carlossg
    Avatar
    Community Member
    13 Posts

    Dropdownfield doesn't seem to work inside getCMSFields_Popup Link to this post

    hi all,

    Need to show a dropdownfield inside the popup of a CMF, it shows up, but when i click save it keeps forever trying to.
    Removing the dropdownfield from the fieldset, works fine!!!
    Here is my code, any ideas? same problem anywhere?

       function getCMSFields_forPopup() {      
          $fields = new FieldSet();          
          $fields->push( new TextField( 'Name', 'First Name' ));
          $fields->push(new TimeField('Time','Time','00:00','G:i'));
    here comes the problem
          $fields->push(new DropdownField('Weekday',
                      'Day of the week',
                      Array('1'=>'Sunday',
    '2'=>'Monday' ... and so on
                             )
                          )
    );      
        return $fields;
    }

    Weekday is enum type in $db

    Weekday=>"enum('Sunday,Monday,Tuesday,Wenesday,Thursday','Sunday');

  • Willr
    Avatar
    Forum Moderator
    5483 Posts

    Re: Dropdownfield doesn't seem to work inside getCMSFields_Popup Link to this post

    It should work fine. Try a capitial E on enum as it is referring to the Enum class in SS so enum might not exist. Then make sure you db/build

    1366 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.