George Hartzell wrote:
> For paranoia's sake, I'd like to check that the page parameter is
> valid, e.g. an integer > 0.
Paranoia is a good thing
> Since I'm using ValidateRM to check all sorts of other things, I
> thought I could use it here, with the call to check_rm just returning
> me to the browse runmode. The problem is that the page parameter is
> still invalid on the next call to the runmode and it recurses
> tragically.
The easiest would be to abstract out the logic for displaying the search results
into a different method that both your original run mode and a new one could
call. Something like this:
sub _display_results { ... }
sub search {
# validate and all that jazz
$self->_display_results(@search_args);
}
sub default_display {
$self->_display_results(@default_args);
}
And then use 'default_display' as the run mode to call if the params aren't
valid.
--
Michael Peters
Developer
Plus Three, LP
---------------------------------------------------------------------
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]