Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

workings of HTML::FormHandler::Wizard #97

Open
nicolasfranck opened this issue Jun 18, 2015 · 0 comments
Open

workings of HTML::FormHandler::Wizard #97

nicolasfranck opened this issue Jun 18, 2015 · 0 comments

Comments

@nicolasfranck
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant