You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Pavel Sapozhnikov <pa...@gmail.com> on 2007/11/03 17:51:05 UTC

Validating array in S1

Hi guys so I have a question I have a List in a form each entry in the List
contains a text box and two check boxes and that is indexed in the form like
I am using indexed properties. Anyway so I am trying to validate one of the
check boxes I want to say that there has to be EXACTLY ONE checked check
box. I did this using custom validation it took me 1 min time but I was
wondering if something like this is possible in validation.xml thanks.

-- 
Pavel Sapozhnikov
xFact, Inc
pavel@xfact.com

Re: Validating array in S1

Posted by Pavel Sapozhnikov <pa...@gmail.com>.
Ok honestly I think we're missing the point here. I need to somehow
reference the count of CHECKED CHECKBOXES and yes I have looked at struts 1
validator guide and I didn't exactly see an example of that unless I am
blind or something or other or maybe I don't see what you see in which case
if you guys could point me in the right direction that would be greatly
appreciated.

On 11/5/07, Martin Gainty <mg...@hotmail.com> wrote:
>
> http://java.sun.com/j2se/1.5.0/docs/api/java/util/ArrayList.html
> Construct ArrayList passing the existing List (a subinterface of a
> Collection) as a param to the constructor
> then getArray method will return your []
>
> M--
> ----- Original Message -----
> From: "Pavel Sapozhnikov" <pa...@gmail.com>
> To: "Struts Users Mailing List" <us...@struts.apache.org>
> Sent: Monday, November 05, 2007 7:47 AM
> Subject: Re: Validating array in S1
>
>
> > But isn't this [] index notation for arrays only? I am using a List.
> >
> > On 11/5/07, Paul Benedict <pb...@apache.org> wrote:
> > >
> > > Look at the Struts user guide. It does support the index [] notation.
> > >
> > > Paul
> > >
> > > On 11/3/07, Pavel Sapozhnikov <pa...@gmail.com> wrote:
> > > >
> > > > Hi guys so I have a question I have a List in a form each entry in
> the
> > > > List
> > > > contains a text box and two check boxes and that is indexed in the
> form
> > > > like
> > > > I am using indexed properties. Anyway so I am trying to validate one
> of
> > > > the
> > > > check boxes I want to say that there has to be EXACTLY ONE checked
> check
> > > > box. I did this using custom validation it took me 1 min time but I
> was
> > > > wondering if something like this is possible in validation.xmlthanks.
> > > >
> > > > --
> > > > Pavel Sapozhnikov
> > > > xFact, Inc
> > > > pavel@xfact.com
> > > >
> > >
> >
> >
> >
> > --
> > Pavel Sapozhnikov
> > xFact, Inc
> > pavel@xfact.com
> >
>
>


-- 
Pavel Sapozhnikov
xFact, Inc
pavel@xfact.com

Re: Validating array in S1

Posted by Pavel Sapozhnikov <pa...@gmail.com>.
But isn't this [] index notation for arrays only? I am using a List.

On 11/5/07, Paul Benedict <pb...@apache.org> wrote:
>
> Look at the Struts user guide. It does support the index [] notation.
>
> Paul
>
> On 11/3/07, Pavel Sapozhnikov <pa...@gmail.com> wrote:
> >
> > Hi guys so I have a question I have a List in a form each entry in the
> > List
> > contains a text box and two check boxes and that is indexed in the form
> > like
> > I am using indexed properties. Anyway so I am trying to validate one of
> > the
> > check boxes I want to say that there has to be EXACTLY ONE checked check
> > box. I did this using custom validation it took me 1 min time but I was
> > wondering if something like this is possible in validation.xml thanks.
> >
> > --
> > Pavel Sapozhnikov
> > xFact, Inc
> > pavel@xfact.com
> >
>



-- 
Pavel Sapozhnikov
xFact, Inc
pavel@xfact.com

Re: Validating array in S1

Posted by Paul Benedict <pb...@apache.org>.
Look at the Struts user guide. It does support the index [] notation.

Paul

On 11/3/07, Pavel Sapozhnikov <pa...@gmail.com> wrote:
>
> Hi guys so I have a question I have a List in a form each entry in the
> List
> contains a text box and two check boxes and that is indexed in the form
> like
> I am using indexed properties. Anyway so I am trying to validate one of
> the
> check boxes I want to say that there has to be EXACTLY ONE checked check
> box. I did this using custom validation it took me 1 min time but I was
> wondering if something like this is possible in validation.xml thanks.
>
> --
> Pavel Sapozhnikov
> xFact, Inc
> pavel@xfact.com
>