You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by perlovdinger <pe...@yahoo.com> on 2003/05/22 17:40:38 UTC

Is there a better approach to repopulate my dynamic form ?

Hi there,

I'm using the DynaValidatorActionForm and use the validator framework 
to perform validation.
It means that I'm declaring the properties in my form-bean properties.
The approach I've taken is to declare my properties as String even if 
they are
int. Then i validate using the framework.
This works fine.

When validation goes through I read the database and then I want to 
repopulate
the values to my form.
I'm using the 	PropertyUtils.copyProperties(vo, form) and I get an 
exception 
**********************************************************************
*************
java.lang.IllegalArgumentException: Cannot invoke 
com.volvocars.vct.struts1.valueOb
ject.ValidatorVo.setIntField2 - argument type mismatch
        at org.apache.commons.beanutils.PropertyUtilsBean.invokeMethod
(PropertyUtil
sBean.java:1767)
        at 
org.apache.commons.beanutils.PropertyUtilsBean.setSimpleProperty
(Propert
**********************************************************************
*************
The problem is that my properrty in my value object is declared as 
int, but as String in
my form bean.

Is there a better approach to repopulate my dynamic form ?


       Thanks in advance
..Per




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