in reply to CGI::Application::ValidateRM detects error, but doesn;t act on it
My test case worked because I didn't make the same mistake I made in my Application.
In my application I have one or two runmodes that handle two actions. Usually a case where I have two buttons on a single form for two related actions on the same data. What I had done was to have two if() blocks for the execution of the two conditions.
Thus the runmode which is doing the validating gets nothing returned from it when it tries to build the response because it does not have the button parameters from the original CGI.pm query.
For CGI::Application::ValidateRM to work the runmode being validated must return valid data to the validating method. Internally the ValidateRM module actually runs the method it is being used to validate. It does this to get the messages into the right place, basically. Then it passes the resultant HTML through HTML::FillInForm with the query parameters it used in the validation process, to get the original values back in the form. If it can't do part one of the process then, well, you get nothing!
Special thank to William McKee on the dfv mailing list for his insightful comment that led me to the solution.
|
|---|