I was using the validation for other form and it's work fine. I just have difficulty to validate field from a extend class. There is a snippet of my code :
The declaration in the <form name="editBottleForm"> <field property="location" depends="required"> <arg0 key="editBottleForm.location.displayName"/> </field> </form> The location field is came from the BottleForm that is the "parent" class of the EditBottleForm The declaration in the struts config : <action path="/editBottle" name="editBottleForm" type="compbottle.actions.search.EditBottleAction" validate="true" input="tiles.search.editBottle"> <forward name="auditTrail" path="tiles.search.auditTrail"/> <forward name="transactionAborted" path="tiles.transactionAborted"/> </action> and finally a part of my code : public class EditBottleForm extends BottleForm { ..... } and public class BottleForm extends ValidatorForm { private String location; public void setLocation(String location) { this.location = location; } public String getLocation() { return location; } ... } -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Thursday, June 30, 2005 3:00 PM To: Struts Users Mailing List Subject: Re: Validator Form and inheritance I take it you are using the Validator plugin? Do you have the xml files setup correctly? Is there a form-bean defined as type AddBottleForm? Is this the type you specify in your action mapping? Does validation.xml have the correct entry for AddBottleForm, according to the name you gave it in struts-config.xml? Are all the fields of that form defined in that section of validation.xml? It might help if you post all the relevant code/xml portions. Erik -----Original Message----- From: [EMAIL PROTECTED] Sent: Jun 30, 2005 2:55 PM To: user@struts.apache.org Subject: Validator Form and inheritance Hi EveryBody, I'm trying to use some inheritance with ValidatorForm. But, when it's time to validate some field from the father class in the child class, it doesn't work. I know that i'm not clear but check this exemple you will understand more : I got a BottleForm class that is extend ValidatorForm and I got two other class (EditBottleForm and AddBottleForm) that extend BottleForm. When I try to validate a "father" variable in one of my child class use, it look like the child class do not know the presence of this "father" variable ( ex : the location ). The design look like this : BottleForm extend ValidatorForm { with location:String } EditBottleForm extend BottleForm { .... } AddBottleForm extend BottleForm { .... } And I'm trying to validate the location in the case of the validation of the AddBottleForm. Someone can help me ? Thanks p.s.: Sorry for my poor english :o) Charles Gouin-Vallerand Software Developper - Co-op Trainee (University of Sherbrooke) AstraZeneca R&D Montreal - DxIx --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]