Re: Trouble with validation of nested properties-indexedListProperty?

2003-08-14 Thread John Tangney
Thanks, Yansheng.

I am not sure I understand. I tried
 
  
 

Is that what you meant? It does the same thing (empty JavaScript.) I don't
understand how your solution is *supposed* to work. I want to validate the
email field of every Info object in the allUsers collection.

Did I misunderstand your suggestion?

Thanks!
--johnt

in article [EMAIL PROTECTED], Yansheng Lin
at [EMAIL PROTECTED] wrote on 8/14/03 8:31 AM:

> 
> I can see one spot that could lead to problem.
> 
> In your iterate,  the var name is "allUsers".  However, in your
> validation.xml,
> the field property is "email".   The name of the iteration var has to be the
> same as the property name of the array in the form.
> 
> Hope this works.
> 
> - Yansheng
> 
> -Original Message-
> From: John Tangney [mailto:[EMAIL PROTECTED]
> Sent: August 13, 2003 5:22 PM
> To: [EMAIL PROTECTED]
> Subject: Trouble with validation of nested properties -indexedListProperty?
> 
> 
> 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:
> 
>   
> 
>   
>   
> 
>   
> 
> 
> 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;
>   }
>   ...
>   }
> 
> Everything's great - works perfectly; does what I want. It's a pattern I use
> all over the place, on several projects.
> 
> Next, I want to add validation:
> 
> In the JSP I add  in the head. My
> form bean now extends ValidatorForm.
> 
> In my validation.xml I add:
> 
> 
>  depends="required,email">
>  
> 
> 
> 
> 
> *** The validation doesn't work.***
> 
> I am more concerned about client-side validation, so let's look at that:
> 
> The generated JavaScript looks like this:
>  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]



Trouble with validation of nested properties -indexedListProperty?

2003-08-14 Thread John Tangney
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:


  


  



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;
}
...
}

Everything's great - works perfectly; does what I want. It's a pattern I use
all over the place, on several projects.

Next, I want to add validation:

In the JSP I add  in the head. My
form bean now extends ValidatorForm.

In my validation.xml I add:

  
  
   
  
  


*** The validation doesn't work.***

I am more concerned about client-side validation, so let's look at that:

The generated JavaScript looks like this:

Re: Trouble with validation of nested properties - indexedListProperty?

2003-08-14 Thread Mark Lowe
The js array that is generated doesn't generate the indexed property 
attributes.

I've been wanting to look in this, so far I've got as far as adding 
myindexedprop[0].property as the property in validator to test whether 
if you can get the array of required properties (for example) whether 
it would work which it does. So in theory the javascript doesn't need a 
tweak but something to do with whatever punches-out the javascript 
array.

This works in terms of the javascript.. Compare the js out put of both 
conditions

 
Using indexedListPRoperty does seem to work..
 
thus its one of those things that needs a bit of looking at.. Its there 
to be done and the indexed property attribute is there. I even read a 
presentation demonstrating use in the way, but thus far I haven't had 
it working.

Not very helpful I guess but thats as far as I've got with this one.

Cheers Mark

On Thursday, August 14, 2003, at 12:22 AM, John Tangney wrote:

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:


  


  

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;
}
...
}
Everything's great - works perfectly; does what I want. It's a pattern 
I use
all over the place, on several projects.

Next, I want to add validation:

In the JSP I add  in the 
head. My
form bean now extends ValidatorForm.

In my validation.xml I add:

  
  
   
  
  
*** The validation doesn't work.***

I am more concerned about client-side validation, so let's look at 
that:

The generated JavaScript looks like this:

RE: Trouble with validation of nested properties -indexedListProperty?

2003-08-14 Thread Yansheng Lin

I can see one spot that could lead to problem.

In your iterate,  the var name is "allUsers".  However, in your validation.xml,
the field property is "email".   The name of the iteration var has to be the
same as the property name of the array in the form.

Hope this works.

- Yansheng

-Original Message-
From: John Tangney [mailto:[EMAIL PROTECTED] 
Sent: August 13, 2003 5:22 PM
To: [EMAIL PROTECTED]
Subject: Trouble with validation of nested properties -indexedListProperty?


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:


  


  



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;
}
...
}

Everything's great - works perfectly; does what I want. It's a pattern I use
all over the place, on several projects.

Next, I want to add validation:

In the JSP I add  in the head. My
form bean now extends ValidatorForm.

In my validation.xml I add:

  
  
   
  
  


*** The validation doesn't work.***

I am more concerned about client-side validation, so let's look at that:

The generated JavaScript looks like this:

Re: Trouble with validation of nested properties -indexedListProperty?

2003-08-14 Thread John Tangney
in article [EMAIL PROTECTED], Mark Lowe at
[EMAIL PROTECTED] wrote on 8/13/03 5:10 PM:

> 
> The js array that is generated doesn't generate the indexed property
> attributes.
Right.

> I've been wanting to look in this, so far I've got as far as adding
> myindexedprop[0].property as the property in validator to test whether
> if you can get the array of required properties (for example) whether
> it would work which it does. So in theory the javascript doesn't need a
> tweak but something to do with whatever punches-out the javascript
> array.
Exactly.
 
> This works in terms of the javascript.. Compare the js out put of both
> conditions
> 
>>  >   depends="required,email">

Hmm. I see what you mean. That gets us the first element... (Yay!)
 
> 
> Using indexedListPRoperty does seem to work..
>>  >   depends="required,email">

???! Maybe I'm misunderstanding you.. This is precisely the case that does
NOT work!

> thus its one of those things that needs a bit of looking at.. Its there
> to be done and the indexed property attribute is there. I even read a
> presentation demonstrating use in the way, but thus far I haven't had
> it working.

I am starting to suspect that it's just a bug. :-(

> Not very helpful I guess but thats as far as I've got with this one.

On the contrary: You've helped me enormously!
> 
> Cheers Mark

Thanks again,
--johnt

> On Thursday, August 14, 2003, at 12:22 AM, John Tangney wrote:
> 
>> 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:
>> 
>> 
>>   
>> 
>> 
>>   
>> 
>> 
>> 
>> 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;
>> }
>> ...
>> }
>> 
>> Everything's great - works perfectly; does what I want. It's a pattern
>> I use
>> all over the place, on several projects.
>> 
>> Next, I want to add validation:
>> 
>> In the JSP I add  in the
>> head. My
>> form bean now extends ValidatorForm.
>> 
>> In my validation.xml I add:
>> 
>>   
>>   >   depends="required,email">
>>
>>   
>>   
>> 
>> 
>> *** The validation doesn't work.***
>> 
>> I am more concerned about client-side validation, so let's look at
>> that:
>> 
>> The generated JavaScript looks like this:
>> > 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]