commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 20449] - [validator] Define flag for validating current page only in multipage form
Date Mon, 09 Jan 2006 17:34:11 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=20449>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=20449





------- Additional Comments From niallp@apache.org  2006-01-09 18:34 -------
When you say "keep a single form" - I assume you mean your ActionForm in Struts 
but that doesn't mean to say there has to be only one "form" definition in 
Validator. Just means you need a slightly custom way to generate the validator 
key - a combination of your form name and something else - lets say "stepNo" 
(so theres no conflict with pageNo):

  public class FooForm extends ValidatorForm {

     private String stepNo;

     public void setStepNo(String stepNo) {
         this.stepNo = stepNo;
     }

     public String getValidationKey(ActionMapping mapping,
                                    HttpServletRequest request) {
        return mapping.getAttribute() + "#" + stepNo;
      }
  }

(This getValidationKey() method was introduced in Struts 1.2.x)

Then define your various pages in the validation.xml...

   <form name="fooForm#A">
       <field property="...">
       </field>
   </form>

   <form name="fooForm#B">
       <field property="...">
       </field>
   </form>

Validator 1.2.0 has the feature to "extend" another form, so you could do 
something like the following if it helps...

   <form name="fooForm#B" extends="fooForm#A">
       <field property="...">
       </field>
   </form>

Is this not something that could work for you? If not maybe you could expand on 
what you mean by "other reasons related to the design of the "Wizard"-like 
Action base class" and why it can't work that way?

Niall

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message