FAQ
hello,

I've a problem with MultiForms, the "first" form shows the data from
db, the "second" form won't - am I doing something wrong?

the controller code:

sub show : Local : MultiFormConfig('auth/show.yml') {
my ( $self, $c ) = @_;

$c->detach('login') if (!$c->user_exists);
if ( $c->stash->{multiform}->complete ) {
...
}

my $row = $c->model('Frontwave::UserDepot')->find($c->user->obj->id);
$row->fill_formfu_values( $c->stash->{multiform}->current_form );
}

form config is trivial, does not depend on any fields, if I replace
fields shown in "1" and place them in "2" no values are shown...

any hints?

regards
josef

ps: btw, carl, thanks for the last answer regarding "multiple
model_stash?", putting resultset and model in model_config did the
trick!

Search Discussions

  • Carl Franks at Apr 9, 2009 at 8:46 am
    Hi,

    One potential problem I've just noticed is - are there any common
    fields names between the 2 forms that would cause the 2nd form to
    think it's already been submitted?
    A hint - set 'indicator' on both forms - but don't set it to 'submit'
    if both forms have a button named 'submit'.

    If this is the problem, then in this line:
    $row->fill_formfu_values( $c->stash->{multiform}->current_form );
    current_form() will be returning undef.

    I think you could test this, by adding a
    die 'complete' if $c->stash->{multiform}->complete;
    after that line.

    I this isn't the problem - then could you send your code for
    fill_formfu_values() ?

    Carl


    2009/4/8 Josef Chladek <josef.chladek@gmail.com>:
    hello,

    I've a problem with MultiForms, the "first" form shows the data from db, the
    "second" form won't - am I doing something wrong?

    the controller code:

    sub show : Local : MultiFormConfig('auth/show.yml') {
    ? ?my ( $self, $c ) = @_;

    ? ? ? ?$c->detach('login') if (!$c->user_exists);
    ? ? ? ?if ( $c->stash->{multiform}->complete ) {
    ? ? ? ?...
    ? ? ? ?}

    ? ? ? ?my $row = $c->model('Frontwave::UserDepot')->find($c->user->obj->id);
    ? ? ? ?$row->fill_formfu_values( $c->stash->{multiform}->current_form );
    }

    form config is trivial, does not depend on any fields, if I replace fields
    shown in "1" and place them in "2" no values are shown...

    any hints?

    regards
    josef

    ps: btw, carl, thanks for the last answer regarding "multiple model_stash?",
    putting resultset and model in model_config did the trick!

    _______________________________________________
    HTML-FormFu mailing list
    HTML-FormFu@lists.scsys.co.uk
    http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/html-formfu
  • Josef Chladek at Apr 9, 2009 at 9:36 am

    Am 09.04.2009 um 10:46 schrieb Carl Franks:

    Hi,

    One potential problem I've just noticed is - are there any common
    fields names between the 2 forms that would cause the 2nd form to
    think it's already been submitted?
    A hint - set 'indicator' on both forms - but don't set it to 'submit'
    if both forms have a button named 'submit'.

    If this is the problem, then in this line:
    $row->fill_formfu_values( $c->stash->{multiform}->current_form );
    current_form() will be returning undef.

    I think you could test this, by adding a
    die 'complete' if $c->stash->{multiform}->complete;
    after that line.

    I this isn't the problem - then could you send your code for
    fill_formfu_values() ?

    Carl
    thanks, I think the problem lies within current_form.
    in my template I have

    [% multiform.current_form_number %]

    which gives "1" for the initial request, after the first submit, it
    stays at "1" but shows form #2, if I submit there, it shows the form
    #2 (which fails with constraints), but then the current_form_number
    shows "2"

    adding indicators to the forms makes the data for form 2 appear after
    a second submit (although the constraints then are not checked, but
    form #3 is initally showed with failed constraints)

    how do I name the indicators correctly?

    regarding fill_formfu_values -> I use still the deprecated
    DBIx::Class::HTML::FormFu (which has this method), but even doing
    manually populating results in the above behaviour

    so how do I get current_form_number to "increment" correctly?

    thanks
    josef

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouphtml-formfu @
categoriesperl, catalyst
postedApr 8, '09 at 7:34p
activeApr 9, '09 at 9:36a
posts3
users2
websitemetacpan.org...

2 users in discussion

Josef Chladek: 2 posts Carl Franks: 1 post

People

Translate

site design / logo © 2022 Grokbase