> Two questions:
> 
> 1. Am I correct is using String as the form-property type?
Yes. This is a best practice approach to have  form properties
be boolean or String
> 
> 2. What should be used as CONDITION so that CONDITION is true if the 
> parameter "id" has been set? (I assume that my validation should 
> make sure 
> "id" is an integer if it is set.)

DynaValidatorForm dynaForm = (DynaValidatorForm)form;
String id = (String)dynaForm.get("id");

if (id != null) {

   /* 
    * Do some work here because
    * property "id" has been 
    * set to some integer value.
    */

}

HTH,

robert


> -----Original Message-----
> From: Adam Sherman [mailto:[EMAIL PROTECTED]
> Sent: Saturday, March 29, 2003 11:45 AM
> To: [EMAIL PROTECTED]
> Subject: Form Field Unset Condition
> 
> 
> I asked a similar question last week and am still having trouble 
> with this 
> simple idea.
> 
> I have a form:
> 
> <form-bean    name="senderEditForm"
>               type="org.apache.struts.validator.DynaValidatorForm">
>       <form-property  name="id"
>                       type="java.lang.String" />
> </form-bean>
> 
> With validation:
> 
> <form name="senderEditForm">
>       <field property="id" depends="integer" />
> </form>
> 
> This Action code:
> 
> DynaValidatorForm  dynaForm  = (DynaValidatorForm) form;
> if ( CONDITION ) {
>       // Do Work If "id" is set
> }
> 
> Two questions:
> 
> 1. Am I correct is using String as the form-property type?
> 
> 2. What should be used as CONDITION so that CONDITION is true if the 
> parameter "id" has been set? (I assume that my validation should 
> make sure 
> "id" is an integer if it is set.)
> 
> Thank you very much for your assistance,
> 
> A.
> 
> --
> Adam Sherman
> Tritus CG Inc.
> http://www.tritus.ca/
> +1 (613) 797-6819
> 
> ---------------------------------------------------------------------
> 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]

Reply via email to