Jump to:

10990 Posts in 2727 Topics by 1818 members

All other Modules

SilverStripe Forums » All other Modules » Multiform and conditional/dynamic fields

Discuss all other Modules here.

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

Page: 1
Go to End
Author Topic: 790 Views
  • rob.s
    Community Member
    78 Posts

    Multiform and conditional/dynamic fields Link to this post


    in my MultiForm Step i need fields dependend on the previous step.

    Let's assume we have 2 DataObject classes:
    1. Category (has_many Article)
    2. Article (has_one Category)

    Step1 shows checkboxes of categories.
    Step 2 should bring up a checkboxfieldset of all Articles having the CategoryID selected in the first step.

    I thought i can access the form data inside the method getFields() in Step2

    function getFields() {
          $data = $this->loadData();

    but the debug output is an empty array.

    (I also checked the database: all selected CategoryIDs are save correctly. When using the previous button of MultiForm the checkboxes of the first step are also populated correctly)

    Any ideas ?



  • rob.s
    Community Member
    78 Posts

    Re: Multiform and conditional/dynamic fields Link to this post

    I created a workaround:

    function getFields() {

          $step = DataObject::get_one(
             "SessionID ={$this->Session()->ID} AND ClassName='ProposalTemplateForm_Step1'"
          if($step) {
             $data = $step->loadData();


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.