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.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

All other Modules /

Discuss all other Modules here.

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

Multi Step Form: Not progressing to next step


Go to End


652 Views

Avatar
Bimble

Community Member, 16 Posts

30 December 2013 at 1:52am

Im trying to create a multi step form. The first step works fine, but after pressing next, I get a no content underneath the title.

Anyone familiar with this module can see any code errors?

<?php

class CSVWizard extends Page {
}

class CSVWizard_Controller extends Page_Controller {
   private static $allowed_actions = array('index', 'CSVWizard');
   public function index(SS_HTTPRequest $request) {
        $this->Content = $this->CSVWizardForm();
        return $this->render();
   }
   public function CSVWizardForm() {
        return new CSVWizardMultiForm($this, 'CSVWizard');
   }
   function finished() {
      return array(
         'Title' => 'Thank you for your submission',
         'Content' => "<p>You have successfully submitted the form!</p>"
      );
   }
}

class CSVWizardMultiForm extends MultiForm {
   public static $start_step = 'CSVSelectFile';
}

class CSVSelectFile extends MultiFormStep {
   public static $next_steps = 'CSVSelectSchema';
   function getFields() {
     return new FieldList(
       new TextField('directory', 'Directory'),
       new TextField('filePattern', 'File Pattern')
     );
   }
}

class CSVSelectSchema extends MultiFormStep {
   public static $next_steps = 'CSVUpdateTask';
   function getFields() {
     return new FieldList(
       new TextField('style', 'Style'),
       new TextField('header', 'Header')
     );
   }
}

class CSVUpdateTask extends MultiFormStep {
   public static $is_final_step = true;
}