Jump to:

17452 Posts in 4473 Topics by 1971 members


SilverStripe Forums » Archive » TreeDropdownField for the Widget

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: 2176 Views
  • Val
    7 Posts

    TreeDropdownField for the Widget Link to this post

    I am trying to create a global Widget. One of the fields in the Widget should be TreeDropdownField. I've managed to display it correctly by using the following code:

    public function getCMSFields() {
    $folder = new TreeDropdownField( 'FolderID', 'Show The Files From', 'Folder' );
    $folder->setFilterFunction( create_function( '$obj', 'return $obj->class == "Folder";' ) );
    return new FieldSet($folder);

    when I am trying to view it and click on the drop down field, I am getting AJAX error that is thrown by sapphire\forms\Form.php, Form::callfieldmethod().

    After executing the following URL

    ERROR:Error 256: Form::callfieldmethod() Field 'Widget[44][FolderID]' not found At l590 in .....\sapphire\forms\Form.php user_error(Form::callfieldmethod() Field 'Widget[44][FolderID]' not found,256) line 590 of Form.php Form->callfieldmethod(Array,Form) line 191 of Controller.php Controller->run(Array) line 76 of Director.php Director::direct(/admin/) line 104 of main.php

    It seems that I can't have [ ]brackets as a fieldName parameter for this particular case.
    Is there any way around this, it would be nice to have an option to display random images from the gallery

  • Blynx
    Community Member
    20 Posts

    Re: TreeDropdownField for the Widget Link to this post

    Did you find any fix to this issue yet? I'm just having the same problem...

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.