Anders wrote:
> Is there some way to postpone the validation? Can i reach
> a method in that action and populate the form before it is validated? Or
> du I have to create a separate action just for this?

This came up recently, check the archives for more info.  I think there's a
proposed enhancement but I don't know if it will be in 1.1.  

A workaround is to override validate() in the DynaValidaorForm and only
validate if the form has really been submitted:

   public ActionErrors validate( ActionMapping mapping,
         HttpServletRequest request )
   {

      /*
       *  only validate if the form has actually been POSTed.
       *  This keeps error messages from appearing when the
       *  form is displayed for the first time.
       */
      if ( request.getMethod().equals( "POST" ) ) {
         return super.validate( mapping, request );
      } else {
         return null;
      }
   }

I was initially checking something else, but the advice from this list was
that checking for POST is the best way to do it.  (This assumes you're
POSTing the form data.  Check the generated HTML <form> tag to make sure.)

-- 
Wendy Smoak
Applications Systems Analyst, Sr.
Arizona State University PA Information Resources Management

Reply via email to