gshank/html-formhandler

workings of HTML::FormHandler::Wizard

nicolasfranck opened this issue · 0 comments

Hi, I'd like to use the wizard, but I'm not sure of how it works.
This is what I think it does:

  1. The wizard is a subclass of the HTML::FormHandler. So all functionality is the same.
  2. The wizard adds "pages". Fields are attached to a page. Switching means setting fields
    to active or inactive.
  3. One can switch between pages by running the method "process" with param "page_num".
my $wizard = HTML::FormHandler::Wizard::Test->new();

#params is empty. page_num "1" is assumed, but not validated: first page appears
$wizard->process(params => {});
print $wizard->render();

#page_num is "1", but validation fails: first page appears with errors
$wizard->process(params => { page_num => 1 });
print $wizard->render();

#page_num is "1", validation successfull: second page appears
$wizard->process(params => { page_num => 1, name => "Nicolas" });
print $wizard->render();

These things are strange:

  • before calling "process", only field page_num is active.
  • when page_num is not set, first page is assumed but not validated. But when you
    set page_num to 1, it is validated?
  • validation errors are shown, but filled in values do not appear in the form.
    I also tried using the method "run", but without effect.

Thanks in advance