You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Anand M S <an...@hotmail.com> on 2003/05/06 21:58:53 UTC
multi page validation and page attribute
I'm using multipage validation and using page attribute and I have page
attribute in my form, and I'm sending value from my form as hidden field,
but it doesn't work, am I missing any thing?
Anand
_________________________________________________________________
The new MSN 8: advanced junk mail protection and 2 months FREE*
http://join.msn.com/?page=features/junkmail
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org
Re: multi page validation and page attribute
Posted by Jeff Kyser <kt...@comcast.net>.
Anand,
Are you using DynaValidatorForm ?
There was a bug reported earlier, setPage did not work.
Someone forwarded me the following subclass of DynaValidatorForm
to get around the problem. My memory is poor, suffering from "what's
his name?'s"
disease or would properly credit the source.
HTH,
-jeff
/**
* DynaValidatorForm - Derived from struts library form because of
error in that class.
*/
public class DynaValidatorForm extends
org.apache.struts.validator.DynaValidatorForm {
public void set(String s, Object o) {
Logger.getLogger("torch.webapp").debug("DynaValidatorForm.set("
+ s + "," + o + ")");
if ("page".equals(s)) {
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);
}
}
>
> I'm using multipage validation and using page attribute and I have
> page attribute in my form, and I'm sending value from my form as
> hidden field, but it doesn't work, am I missing any thing?
>
>
> Anand
>
>
>
> _________________________________________________________________
> The new MSN 8: advanced junk mail protection and 2 months FREE*
> http://join.msn.com/?page=features/junkmail
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org