Jump to:

17452 Posts in 4473 Topics by 1971 members

Archive

SilverStripe Forums » Archive » ComplexTableField in 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: 1323 Views
  • abes
    Avatar
    Community Member
    11 Posts

    ComplexTableField in Popup Link to this post

    I want to place a ComplexTableField into a tab in a popup. There is a ComplexTableField in the CMS with a list of companies. In the editing popup there is another ComplexTableField with all stores of the selected company. (Perhaps there is a better solution for this?)

       /**
        * Generate fieldset for administration popup.
        */
       function getCMSFields_forPopup ()
       {
          $fields = new FieldSet();
          
          $masterdataTab = new Tab('Stammdaten');
          $storeTab = new Tab('Filialen');
          
          $tabset = new TabSet("Root",
                $masterdataTab,
                $storeTab
          );
          $fields->push( $tabset );
          
          [ ... ]
          
          $storeField = new ComplexTableField(
                $this,
                'Filialen',
                'CompanyStore',
                array(
                   'ID' => 'ID',
                   'Street' => 'Straße',
                   'Zipcode' => 'PLZ',
                   'City' => 'Stadt'
                ),
                'getCMSFields_forPopup'
          );

          $storeTab->push( $storeField );
          
          return $fields;
       }

    Unfortunately there happens "an error".
    There has been an error (I love those error messages^^)

    If I place the same ComplexTableField in a tab directly in the cms and not in the popup, it works fine.

    Can anybody suggest, where the failure is? Is it not possible to add an ComplexTableField into a popup?

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