Please disregard my previous email. IT WORKS JUST FINE !!!

I was getting problem during loading because my validation.xml was not
right. I just did exactly what Niall mentioned in his mail and its work
just fine. 

Thanks Niall.


-----Original Message-----
From: Niall Pemberton [mailto:[EMAIL PROTECTED] 
Sent: Thursday, September 28, 2006 6:09 PM
To: Struts Users Mailing List
Subject: Re: index value in custom validation message ?

Not sure if I understand what the issue is. In validator terms there
is no requirement that what you define in a <form> element be anything
other than a regular java bean.

So as I understand it you have an ActionForm which has a property for
the collection of PERSON objects - say called "people", with
appropriate getPeople() / setPeople() methods

<form name="FooForm">

    <field property="people" depends="extends">
 
<var><var-name>extends<var-name><var-value>PERSON<var-value></var>
        <arg0 key="lineNumber">
     </field>

</form>

<form name="PERSON">

    <field property="ssn" depends="required">
        <arg0 key="SSN" resource="false">
        <msg name="required" key="ssn.errors.required">
    </field>

</form>

To be honest I'm confused by you saying "how to do it with out
actually extending from any other form" - since I'm not sure if you're
thinking that your "PERSON" java object has to inherit from an
ActionForm (which it doesn't in this scenario) or whether you just
don't want your validation config to "extend" - but that would make no
sense with an "extends" validator.

Best thing is - why don't you give it a try and see if it meets your
needs.

Niall

On 9/28/06, Tejesh Shetty <[EMAIL PROTECTED]> wrote:
> Niall,
>
> Struts extends looks promising..getting the index value works when
that
> field actually extends from some other form..
>
> I have a form with collection of 'PERSON' in it. And every person has
> property like first name, last name, ssn.
>
> Now I want to validate if ssn for  all the 'PERSON's are entered. So
> field to be validated will be ssn so I cant make out from struts
extend
> documentation how to do it with out actually extending from any other
> form.
>
> Thanks.
>
> TJ.
>
> -----Original Message-----
> From: Niall Pemberton [mailto:[EMAIL PROTECTED]
> Sent: Thursday, September 28, 2006 12:03 AM
> To: Struts Users Mailing List
> Subject: Re: index value in custom validation message ?
>
> Theres nothing in struts to help you do this - but the extends
> validator can but it only does server side - see the indexed example:
>
>
http://www.niallp.pwp.blueyonder.co.uk/strutsvalidatorextends.html#index
> ed
>
> Niall
>
> On 9/28/06, Tejesh Shetty <[EMAIL PROTECTED]> wrote:
> > I am using struts 1.2.8, and I am validating an indexed property and
> > everything works just fine. When validation fails for an item I want
> to
> > display action message saying Item <i> is required, I was finding a
> way
> > to do that couldn't find anything.
> >
> > Can anyone please suggest how to get this working?
> >
> > TJ.

---------------------------------------------------------------------
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