[cgiapp] submit returns allways to the same run mode.

Erez David introx at gmail.com
Mon Mar 15 05:19:17 EDT 2010


Thanks,

That helped.


Erez

On Sun, Mar 14, 2010 at 10:55 AM, Rhesa Rozendaal <perl at rhesa.com> wrote:

> > On Sun, Mar 14, 2010 at 10:42 AM, Erez David <introx at gmail.com> wrote:
> >
> >> Hi,
> >>
> >> In my application I have few run modes (Each run mode represent a
> different
> >> tab in the application) but whenever I press the submit button of one of
> the
> >> tabs, It qllways bring me back to the first run mode which I have
> defined in
> >> the setup by calling the start_mode method.
> >>
> >> sub setup {
> >> my $self = shift;
> >>         $self->start_mode('builder_project');
> >>         $self->mode_param('rm');
> >>     $self->run_modes(
> >>
> >>
> >>         'builder_project' => 'builder_project_tab',
> >>         'builder_users' => 'builder_users_tab',
> >>  'builder_dir_structure' => 'builder_dir_structure_tab',
> >>
> >> In the html of this tab I have the following form tag: <form name=conf
> >> method="post" action="?rm=configuration">
>
> CGI::Application only looks for $self->query->param('rm') by default, so
> for
> POST requests, you need to add a hidden input with the rm. The URL param
> you
> put in the action is ignored.
>
> This means your form should look like:
>
>   <form name="conf" method="post" action="?">
>      <input type="hidden" name="rm" value="configuration">
>
> The other alternative is to make cgiapp look for a url param if there is no
> regular query param, but that's a bit more involved.
>
> HTH,
> Rhesa
>
> #####  CGI::Application community mailing list  ################
> ##                                                            ##
> ##  To unsubscribe, or change your message delivery options,  ##
> ##  visit:  http://lists.openlib.org/mailman/listinfo/cgiapp    ##
> ##                                                            ##
> ##  Web archive:   http://lists.openlib.org/pipermail/cgiapp/   ##
> ##  Wiki:          http://cgiapp.erlbaum.net/                 ##
> ##                                                            ##
> ################################################################
>
>


More information about the cgiapp mailing list