Barry Volpe wrote:
> With an Action Form we do the following:
> form = new UserForm();
> form.setUserid("5"); 
> What is the equivalent for a DynaValidatorForm?????
> Let's say my DynaValidatorForm is myForm
> Of course this does not work (compiler does not know what myForm
is.)....
> DynaValidatorForm dynaForm = (DynaValidatorForm)myForm; 
> myForm.setUserid("5");

http://jakarta.apache.org/struts/userGuide/building_controller.html#dyna
_action_form_classes

"DynaActionForms are not a drop-in replacement for ActionForms. If you
need to access ActionForm properties in your Action, you will need to
use the map-style accessor, like myForm.get("name"). If you actively use
the ActionForm object in your Action, then you may want to use
conventional ActionForms instead."

I populate mine largely with BeanUtils.copyProperties(...).  If you need
to address a specific property, you can use the Map contained within the
DVForm:

> DynaValidatorForm dynaForm = (DynaValidatorForm)myForm; 
> myForm.setUserid("5");

2nd line becomes:
myForm.set("userid","5");

http://jakarta.apache.org/struts/api/org/apache/struts/validator/DynaVal
idatorForm.html

-- 
Wendy Smoak
Applications Systems Analyst, Sr.
Arizona State University, PA, IRM 


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

Reply via email to