Return-Path: Delivered-To: apmail-jakarta-struts-user-archive@www.apache.org Received: (qmail 43416 invoked from network); 25 Sep 2003 21:39:25 -0000 Received: from daedalus.apache.org (HELO mail.apache.org) (208.185.179.12) by minotaur-2.apache.org with SMTP; 25 Sep 2003 21:39:25 -0000 Received: (qmail 94173 invoked by uid 500); 25 Sep 2003 21:38:52 -0000 Delivered-To: apmail-jakarta-struts-user-archive@jakarta.apache.org Received: (qmail 94148 invoked by uid 500); 25 Sep 2003 21:38:52 -0000 Mailing-List: contact struts-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Struts Users Mailing List" Reply-To: "Struts Users Mailing List" Delivered-To: mailing list struts-user@jakarta.apache.org Received: (qmail 94135 invoked from network); 25 Sep 2003 21:38:52 -0000 Received: from unknown (HELO post3.inre.asu.edu) (129.219.113.218) by daedalus.apache.org with SMTP; 25 Sep 2003 21:38:52 -0000 Received: from conversion.post3.inre.asu.edu by asu.edu (PMDF V6.1-1X6 #30769) id <0HLS00B01GYG8B@asu.edu> for struts-user@jakarta.apache.org; Thu, 25 Sep 2003 14:27:53 -0700 (MST) Received: from ex3.asurite.ad.asu.edu (ex3.asurite.ad.asu.edu [129.219.10.247]) by asu.edu (PMDF V6.1-1X6 #30769) with ESMTP id <0HLS00A92GYGXT@asu.edu> for struts-user@jakarta.apache.org; Thu, 25 Sep 2003 14:27:52 -0700 (MST) Date: Thu, 25 Sep 2003 14:27:53 -0700 From: Wendy Smoak Subject: RE: How do I populate a DynaValidatorForm? To: Struts Users Mailing List Message-id: MIME-version: 1.0 X-MIMEOLE: Produced By Microsoft Exchange V6.0.6375.0 Content-type: text/plain; charset=us-ascii Content-transfer-encoding: quoted-printable Thread-Topic: How do I populate a DynaValidatorForm? Thread-Index: AcODqkSfeFc67zOpSEipxTXLx+K8UAAAKlmQ content-class: urn:content-classes:message X-MS-Has-Attach: X-MS-TNEF-Correlator: X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N Barry Volpe wrote: > With an Action Form we do the following: > form =3D new UserForm(); > form.setUserid("5");=20 > 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 =3D (DynaValidatorForm)myForm;=20 > 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 =3D (DynaValidatorForm)myForm;=20 > myForm.setUserid("5"); 2nd line becomes: myForm.set("userid","5"); http://jakarta.apache.org/struts/api/org/apache/struts/validator/DynaVal idatorForm.html --=20 Wendy Smoak Applications Systems Analyst, Sr. Arizona State University, PA, IRM=20 --------------------------------------------------------------------- To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org For additional commands, e-mail: struts-user-help@jakarta.apache.org