You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Samip Ladhawala <sa...@yahoo.com> on 2002/05/06 20:00:48 UTC

Nested Tags and Validator URGENT!!!!!!!!!

Hi,

I have some problems in using validator with nested tags. I am using struts1.1.  

I have a form bean named say AccountForm. In this form bean I have an attribute called say listOfAcctCodes, which is an arraylist of AccountCode. AccountCode is again a class, which contains an attribute named location_cd. Now evrything works fine with this as far as getting and setting of location_cd is concerned. But validation on location_cd doesn't seem to be working. location_cd is a nested:text in jsp. 

I debugged the application and found that  PropertyUtils.getProperty(bean, property) looks for location_cd in AccountForm instead of nesting it and looking in AccountCodes and throws an exception "NoSuchMethod Exception", "Unknown property location_cd". 

So I am not sure whether validator will work with collections or not? Did somebody use validator with nested collections? Please help me out!!!

Thanks,

Samip Ladhawala. 



---------------------------------
Do You Yahoo!?
Yahoo! Health - your guide to health and wellness

Re: Nested Tags and Validator URGENT!!!!!!!!!

Posted by David Winterfeldt <dw...@yahoo.com>.
Do you have the validation for the field like this?

indexedListProperty - the property that will retrieve
the list
property - the property to retrieve a value from an
item in the list

<field property="value"
       indexedListProperty="nameList"
       depends="required">
   <arg0 key="typeForm.nested.name.displayname"/>
</field> 


David

--- Samip Ladhawala <sa...@yahoo.com> wrote:
> 
> Hi,
> 
> I have some problems in using validator with nested
> tags. I am using struts1.1.  
> 
> I have a form bean named say AccountForm. In this
> form bean I have an attribute called say
> listOfAcctCodes, which is an arraylist of
> AccountCode. AccountCode is again a class, which
> contains an attribute named location_cd. Now
> evrything works fine with this as far as getting and
> setting of location_cd is concerned. But validation
> on location_cd doesn't seem to be working.
> location_cd is a nested:text in jsp. 
> 
> I debugged the application and found that 
> PropertyUtils.getProperty(bean, property) looks for
> location_cd in AccountForm instead of nesting it and
> looking in AccountCodes and throws an exception
> "NoSuchMethod Exception", "Unknown property
> location_cd". 
> 
> So I am not sure whether validator will work with
> collections or not? Did somebody use validator with
> nested collections? Please help me out!!!
> 
> Thanks,
> 
> Samip Ladhawala. 
> 
> 
> 
> ---------------------------------
> Do You Yahoo!?
> Yahoo! Health - your guide to health and wellness


__________________________________________________
Do You Yahoo!?
Yahoo! Health - your guide to health and wellness
http://health.yahoo.com

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>