Java Mailing List Archive

http://www.junlu.com/

Home » Home (12/2007) » Struts 2 »

Re: Trouble with validation of nested properties -  indexedListProperty?

Paul Niedenzu

2006-12-05

Replies:

John Tangney <johnt <at> jdtangney.com> writes:

>
> Hi all,
>
> I have memorized the docs, scoured the archives, googled 'till my eyes were
> crossed, experimented at great length, but have not been able to solve this
> riddle.
>
> I have a JSP that looks like this:
>
>   <nested:iterate property="allUsers">
>     <tr>
>      <td><nested:text property="userName"/></td>
>      <td><nested:text property="email"/></td>
>     </tr>
>   </nested:iterate>
>
> My form bean has
>
>   public List getAllUsers() {
>      return this.allUsers;
>   }
>
> Which returns a collection of...
>
>   public static class Info {    // an inner class of the form bean, FWIW
>      private String email;
>      private String userName;
>
>      public void setEmail(String string) {
>         email = string;
>      }
>
>      public String getEmail() {
>         return email;
>      }
>      ...
>   }
>


Hi John (and others)

I read your article with great interest since I encounter this exact problem!
I read the posted answers too that come to the conclusion that the wrong js is
generated. So far so good, but how do we solve the problem? I tried (as in one
of the answers) addressing the first elelement of the List directly by its
index in validation.xml . That works fine... BUT... I have a variable size
List on the jsp :-(

Any suggestions?

Thanks in advance!!

Paul







---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@(protected)
For additional commands, e-mail: user-help@(protected)

©2008 junlu.com - Jax Systems, LLC, U.S.A.