DynaValidatorActionForm and DynaValidatorForm don't work for multipage
forms.  The page attr is not being set for dynamic forms.  

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

The patch is pretty easy, but this got marked for 1.2.  The patch I use
locally 
is:

public class MyForm extends DynaValidatorForm {
    public void set(String s, Object o) {
        if ( s.equals("page") ){
            if ( o != null ){
                String val = o.toString();
                if ( val != null && ( val.length() > 0 )) {
                    try {
                        super.setPage( Integer.parseInt(val) );
                    } catch (NumberFormatException e) {
                        // Oh well.
                        super.setPage(0);
                    }
                } else {
                    super.setPage(0);
                }
            }

        }
        super.set(s, o);
    }
    public void setPage(int i) {
        set("page", ""+i);
    }
}

-----Original Message-----
From: Brian Blignaut [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, February 19, 2003 3:57 AM
To: [EMAIL PROTECTED]
Subject: Mutliform validation using a DynaValidatorForm


Hi,

Has anyone attempted to use the 'page' property of a field, with a 
DynaValidatorForm? It seems to me that there is a bug around doing this?

Thanks
Brian


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to