On Friday 31 August 2007 12:47 pm, George Hartzell wrote:
> Graham TerMarsch writes:
>  > sub processMypage {
>  >     my $self = shift;
>  >     # validate, showing error if invalid
>  >     my $res = $self->check_rm( 'mypage',
>  >         { 'required' => [qw( widget )],
>  >           'defaults' => {
>  >               'widget' => 1,
>  >           },
>  >           'constraint_methods' => {
>  >               'widget' => FV_num_int(),
>  >           },
>  >           'msgs' => {
>  >               'any_errors' => 'dfv_errors',
>  >               'prefix' => 'err_',
>  >           },
>  >         } );
>  >     unless ($res) {
>  >         return $self->check_rm_error_page();
>  >     }
>  >     # data ok, show form again.
>  >     return $self->showMypage();
>  > }
>
> This suffers from the same problem that's been biting me, you've just
> added another level of indirection.
>
>   mypage gets called and sees the submit_button
>
>   it calls processMypage, which check_rm's, see's the bad value and
>   calls check_rm_error_page, which points back to mypage
>
>   mypage gets called and sees the submit_button

Sorry, that should've been "showMyPage" in the call to "check_rm()" above.

Switching it to "showMyPage" causes -just- the redisplay of the page, without 
the check for 'submit_button' which creates the recursive problem.

-- 
Graham TerMarsch

---------------------------------------------------------------------
Web Archive:  http://www.mail-archive.com/[email protected]/
              http://marc.theaimsgroup.com/?l=cgiapp&r=1&w=2
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to