forwarder / meteor-wizard

A wizard component for Autoform.
MIT License
67 stars 17 forks source link

More than 2 steps issue #50

Closed nalexeric closed 9 years ago

nalexeric commented 9 years ago

Can someone please upload a simple example with more than 2 steps?

I've downloaded the example, simply added a third step between the two that are already defined, but I can't get past the second step. After I fill in the data from the first step and hit 'Next', the 'Next' button on the second step is active for half a second or so, and then becomes disabled. Moreover, after I hit 'Back' to get back to step one, the 'Next' button on the first step becomes disabled as well.

This is the relevant code where I think I'm doing something wrong.

Template.basic.helpers({
  steps: function() {
    return [{
      id: 'contact-information',
      title: 'Contact information',
      schema: Schemas.contactInformation
    }, {
      id: 'foo',
      title: 'foo',
      schema: Schemas.foo
    }, {
      id: 'payment-information',
      title: 'Payment & confirm',
      schema: Schemas.paymentInformation,
      onSubmit: function(data, wizard) {
        var self = this;
        Orders.insert(_.extend(wizard.mergedData(), data), function(err, id) {
          if (err) {
            self.done();
          } else {
            Router.go('viewOrder', {
              _id: id
            });
            console.log(wizard.mergedData());
            wizard.clearData();
          }
        });
      }
    }];
  }
});
nalexeric commented 9 years ago

Fixed by creating custom templates for each step.

brylie commented 8 years ago

I have this same issue. It would be good for the documentation to indicate that forms with greater than two steps do not work. This seems like a bug to me.

jail1 commented 8 years ago

Exactly. Not workig with more than 2 steps. I have created a template factory.

brylie commented 8 years ago

Alright, I have opened this issue in #62, since this issue was closed prematurely.