You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by "Cato (Pete)" <ca...@catosplace.co.nz> on 2004/10/27 01:18:23 UTC

validwhen problem

I am trying to force a field to have a value if a checkbox is checked 
using validwhen in my validation.xml.

I am having a few problems:

1) The field to fill in has an initial value of 0. If this is zero and 
the box is unchecked this is valid ( I can't get this to work ) I can 
get it to check for an empty field.

2) If the checkbox is checked I need the value to not be 0. I can do 
this but not at the same time as the above check!!

3) When validation fails my page returns an exception about a drop down 
list that was set up in a 'set-up' action prior to the page being validated.

Any help on this would be much appreciated.

Pete.




---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: validwhen problem

Posted by "Cato (Pete)" <ca...@catosplace.co.nz>.
Niall,

Shall try that later. At work just now, so can't download the new 
version here.

Could I just ask quickly - does the validation take place client side or 
server side? - Could you help with the drop down issue I had as a result?

Niall Pemberton wrote:
> I fixed a bug in Version 1.2.5 to do with numeric values in validwhen. Can
> you try it out and see if it fixes your problem.
> 
> Its available here:
> 
> http://svn.apache.org/dist/struts/v1.2.5/
> 
> Please note,Version 1.2.5 is only a *test* build and hasn't been "released"
> 
> Niall
> 
> ----- Original Message ----- 
> From: "Cato (Pete)" <ca...@catosplace.co.nz>
> To: <us...@struts.apache.org>
> Sent: Wednesday, October 27, 2004 12:18 AM
> Subject: validwhen problem
> 
> 
> 
>>I am trying to force a field to have a value if a checkbox is checked
>>using validwhen in my validation.xml.
>>
>>I am having a few problems:
>>
>>1) The field to fill in has an initial value of 0. If this is zero and
>>the box is unchecked this is valid ( I can't get this to work ) I can
>>get it to check for an empty field.
>>
>>2) If the checkbox is checked I need the value to not be 0. I can do
>>this but not at the same time as the above check!!
>>
>>3) When validation fails my page returns an exception about a drop down
>>list that was set up in a 'set-up' action prior to the page being
> 
> validated.
> 
>>Any help on this would be much appreciated.
>>
>>Pete.
> 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 



---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: validwhen problem

Posted by "Cato (Pete)" <ca...@catosplace.co.nz>.
Niall - Thanks for your help..will try that tonight.

Niall Pemberton wrote:

> Looks OK to me, so give 1.2.5 a go and see if that works.
> 
> ----- Original Message ----- 
> From: "Cato (Pete)" <ca...@catosplace.co.nz>
> To: "Struts Users Mailing List" <us...@struts.apache.org>
> Sent: Wednesday, October 27, 2004 12:36 AM
> Subject: Re: validwhen problem
> 
> 
> 
>>Code Below
>>
>><var-value>
>>   ( ((hasSold == null) and (*this* == 0))
>>     or ((hasSold != null) and (*this* != 0))
>>   )
>></var-value>
>>
>>Niall Pemberton wrote:
>>
>>
>>>On second thoughts, maybe you should post the relevant bit of your
>>>validation.xml showing the *test* parameter yoour trying to use first
>>>
>>>Niall
>>>
>>>----- Original Message ----- 
>>>From: "Niall Pemberton" <ni...@blueyonder.co.uk>
>>>To: "Struts Users Mailing List" <us...@struts.apache.org>
>>>Sent: Wednesday, October 27, 2004 12:32 AM
>>>Subject: Re: validwhen problem
>>>
>>>
>>>
>>>
>>>>I fixed a bug in Version 1.2.5 to do with numeric values in validwhen.
> 
> Can
> 
>>>>you try it out and see if it fixes your problem.
>>>>
>>>>Its available here:
>>>>
>>>>http://svn.apache.org/dist/struts/v1.2.5/
>>>>
>>>>Please note,Version 1.2.5 is only a *test* build and hasn't been
>>>
>>>"released"
>>>
>>>
>>>>Niall
>>>>
>>>>----- Original Message ----- 
>>>>From: "Cato (Pete)" <ca...@catosplace.co.nz>
>>>>To: <us...@struts.apache.org>
>>>>Sent: Wednesday, October 27, 2004 12:18 AM
>>>>Subject: validwhen problem
>>>>
>>>>
>>>>
>>>>
>>>>>I am trying to force a field to have a value if a checkbox is checked
>>>>>using validwhen in my validation.xml.
>>>>>
>>>>>I am having a few problems:
>>>>>
>>>>>1) The field to fill in has an initial value of 0. If this is zero and
>>>>>the box is unchecked this is valid ( I can't get this to work ) I can
>>>>>get it to check for an empty field.
>>>>>
>>>>>2) If the checkbox is checked I need the value to not be 0. I can do
>>>>>this but not at the same time as the above check!!
>>>>>
>>>>>3) When validation fails my page returns an exception about a drop down
>>>>>list that was set up in a 'set-up' action prior to the page being
>>>>
>>>>validated.
>>>>
>>>>
>>>>>Any help on this would be much appreciated.
>>>>>
>>>>>Pete.
>>>>
>>>>
>>>>
>>>>---------------------------------------------------------------------
>>>>To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>>>>For additional commands, e-mail: user-help@struts.apache.org
>>>>
>>>>
>>>>
>>>
>>>
>>>
>>>
>>>---------------------------------------------------------------------
>>>To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>>>For additional commands, e-mail: user-help@struts.apache.org
>>>
>>
>>
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>>For additional commands, e-mail: user-help@struts.apache.org
>>
>>
>>
> 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 



---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: validwhen problem

Posted by Niall Pemberton <ni...@blueyonder.co.uk>.
Looks OK to me, so give 1.2.5 a go and see if that works.

----- Original Message ----- 
From: "Cato (Pete)" <ca...@catosplace.co.nz>
To: "Struts Users Mailing List" <us...@struts.apache.org>
Sent: Wednesday, October 27, 2004 12:36 AM
Subject: Re: validwhen problem


> Code Below
>
> <var-value>
>    ( ((hasSold == null) and (*this* == 0))
>      or ((hasSold != null) and (*this* != 0))
>    )
> </var-value>
>
> Niall Pemberton wrote:
>
> > On second thoughts, maybe you should post the relevant bit of your
> > validation.xml showing the *test* parameter yoour trying to use first
> >
> > Niall
> >
> > ----- Original Message ----- 
> > From: "Niall Pemberton" <ni...@blueyonder.co.uk>
> > To: "Struts Users Mailing List" <us...@struts.apache.org>
> > Sent: Wednesday, October 27, 2004 12:32 AM
> > Subject: Re: validwhen problem
> >
> >
> >
> >>I fixed a bug in Version 1.2.5 to do with numeric values in validwhen.
Can
> >>you try it out and see if it fixes your problem.
> >>
> >>Its available here:
> >>
> >>http://svn.apache.org/dist/struts/v1.2.5/
> >>
> >>Please note,Version 1.2.5 is only a *test* build and hasn't been
> >
> > "released"
> >
> >>Niall
> >>
> >>----- Original Message ----- 
> >>From: "Cato (Pete)" <ca...@catosplace.co.nz>
> >>To: <us...@struts.apache.org>
> >>Sent: Wednesday, October 27, 2004 12:18 AM
> >>Subject: validwhen problem
> >>
> >>
> >>
> >>>I am trying to force a field to have a value if a checkbox is checked
> >>>using validwhen in my validation.xml.
> >>>
> >>>I am having a few problems:
> >>>
> >>>1) The field to fill in has an initial value of 0. If this is zero and
> >>>the box is unchecked this is valid ( I can't get this to work ) I can
> >>>get it to check for an empty field.
> >>>
> >>>2) If the checkbox is checked I need the value to not be 0. I can do
> >>>this but not at the same time as the above check!!
> >>>
> >>>3) When validation fails my page returns an exception about a drop down
> >>>list that was set up in a 'set-up' action prior to the page being
> >>
> >>validated.
> >>
> >>>Any help on this would be much appreciated.
> >>>
> >>>Pete.
> >>
> >>
> >>
> >>---------------------------------------------------------------------
> >>To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> >>For additional commands, e-mail: user-help@struts.apache.org
> >>
> >>
> >>
> >
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> > For additional commands, e-mail: user-help@struts.apache.org
> >
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>
>



---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: validwhen problem

Posted by "Cato (Pete)" <ca...@catosplace.co.nz>.
Code Below

<var-value>
   (	((hasSold == null) and (*this* == 0))
     or	((hasSold != null) and (*this* != 0))
   )
</var-value>

Niall Pemberton wrote:

> On second thoughts, maybe you should post the relevant bit of your
> validation.xml showing the *test* parameter yoour trying to use first
> 
> Niall
> 
> ----- Original Message ----- 
> From: "Niall Pemberton" <ni...@blueyonder.co.uk>
> To: "Struts Users Mailing List" <us...@struts.apache.org>
> Sent: Wednesday, October 27, 2004 12:32 AM
> Subject: Re: validwhen problem
> 
> 
> 
>>I fixed a bug in Version 1.2.5 to do with numeric values in validwhen. Can
>>you try it out and see if it fixes your problem.
>>
>>Its available here:
>>
>>http://svn.apache.org/dist/struts/v1.2.5/
>>
>>Please note,Version 1.2.5 is only a *test* build and hasn't been
> 
> "released"
> 
>>Niall
>>
>>----- Original Message ----- 
>>From: "Cato (Pete)" <ca...@catosplace.co.nz>
>>To: <us...@struts.apache.org>
>>Sent: Wednesday, October 27, 2004 12:18 AM
>>Subject: validwhen problem
>>
>>
>>
>>>I am trying to force a field to have a value if a checkbox is checked
>>>using validwhen in my validation.xml.
>>>
>>>I am having a few problems:
>>>
>>>1) The field to fill in has an initial value of 0. If this is zero and
>>>the box is unchecked this is valid ( I can't get this to work ) I can
>>>get it to check for an empty field.
>>>
>>>2) If the checkbox is checked I need the value to not be 0. I can do
>>>this but not at the same time as the above check!!
>>>
>>>3) When validation fails my page returns an exception about a drop down
>>>list that was set up in a 'set-up' action prior to the page being
>>
>>validated.
>>
>>>Any help on this would be much appreciated.
>>>
>>>Pete.
>>
>>
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>>For additional commands, e-mail: user-help@struts.apache.org
>>
>>
>>
> 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 



---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: validwhen problem

Posted by Niall Pemberton <ni...@blueyonder.co.uk>.
On second thoughts, maybe you should post the relevant bit of your
validation.xml showing the *test* parameter yoour trying to use first

Niall

----- Original Message ----- 
From: "Niall Pemberton" <ni...@blueyonder.co.uk>
To: "Struts Users Mailing List" <us...@struts.apache.org>
Sent: Wednesday, October 27, 2004 12:32 AM
Subject: Re: validwhen problem


> I fixed a bug in Version 1.2.5 to do with numeric values in validwhen. Can
> you try it out and see if it fixes your problem.
>
> Its available here:
>
> http://svn.apache.org/dist/struts/v1.2.5/
>
> Please note,Version 1.2.5 is only a *test* build and hasn't been
"released"
>
> Niall
>
> ----- Original Message ----- 
> From: "Cato (Pete)" <ca...@catosplace.co.nz>
> To: <us...@struts.apache.org>
> Sent: Wednesday, October 27, 2004 12:18 AM
> Subject: validwhen problem
>
>
> > I am trying to force a field to have a value if a checkbox is checked
> > using validwhen in my validation.xml.
> >
> > I am having a few problems:
> >
> > 1) The field to fill in has an initial value of 0. If this is zero and
> > the box is unchecked this is valid ( I can't get this to work ) I can
> > get it to check for an empty field.
> >
> > 2) If the checkbox is checked I need the value to not be 0. I can do
> > this but not at the same time as the above check!!
> >
> > 3) When validation fails my page returns an exception about a drop down
> > list that was set up in a 'set-up' action prior to the page being
> validated.
> >
> > Any help on this would be much appreciated.
> >
> > Pete.
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>
>



---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: validwhen problem

Posted by Niall Pemberton <ni...@blueyonder.co.uk>.
I fixed a bug in Version 1.2.5 to do with numeric values in validwhen. Can
you try it out and see if it fixes your problem.

Its available here:

http://svn.apache.org/dist/struts/v1.2.5/

Please note,Version 1.2.5 is only a *test* build and hasn't been "released"

Niall

----- Original Message ----- 
From: "Cato (Pete)" <ca...@catosplace.co.nz>
To: <us...@struts.apache.org>
Sent: Wednesday, October 27, 2004 12:18 AM
Subject: validwhen problem


> I am trying to force a field to have a value if a checkbox is checked
> using validwhen in my validation.xml.
>
> I am having a few problems:
>
> 1) The field to fill in has an initial value of 0. If this is zero and
> the box is unchecked this is valid ( I can't get this to work ) I can
> get it to check for an empty field.
>
> 2) If the checkbox is checked I need the value to not be 0. I can do
> this but not at the same time as the above check!!
>
> 3) When validation fails my page returns an exception about a drop down
> list that was set up in a 'set-up' action prior to the page being
validated.
>
> Any help on this would be much appreciated.
>
> Pete.



---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org