problem with requiredif and validwhen

2010-04-02 Thread vivek mahajan
HI,
I have gone through User's Guide provided in your website for the
use requiredif and validwhen in struts 1.3 but i m not getting the
desired result. please help me. I am providing the code below. Date
field is required when byDate is selected which is a radio button.
field
property=byDate
depends=required
arg0 key=By Date resource=false/
/field
field
property=date
depends=requiredif
arg0 key=Date resource=false/
var
var-namefield[0]/var-name
var-valuebyDate/var-value
/var
var
var-namefieldTest[0]/var-name
var-valueEQUAL/var-value
/var
var
var-namefieldValue[0]/var-name
var-valuebydate/var-value
/var
/field

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



Requiredif validator

2007-09-07 Thread Pablo Vázquez Blázquez

Hi all!

I´m trying to validate two fields that depends on another field.

What I was doing in S1 is (for field in):

field property=in depends=requiredif
   msg name=validwhen 
key=ErrorMessages.applicationIdRepresent.sameReference/

   arg position=0 key=ProcessorHTTPDetails.in/
   msg name=mask key=ProcessorHTTPDetails.in.help/
   var
var-namefield[0]/var-name
   var-valueeditParams/var-value
   /var
   var
   var-namefieldTest[0]/var-name
   var-valueNOTNULL/var-value
   /var
/field

But now in S2, there is no requiredif validator :(

Any idea about how can I do to get the same validation effect?

Thanks.



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Requiredif validator

2007-09-07 Thread Gundersen, Richard
Hi Pablo

Try using validwhen instead - I think rewquiredif was deprecated. I changed all 
mine and you can achive the same thing although your logic might have to be 
turned around a bit. 

Here's an example:

form name=completionForm extends=commonBankForm
  field property=registeredTitle depends=required
  arg key=completion.registered.title/
  /field
  field property=titleNo depends=validwhen
  arg key=completion.title.no/
  var
  var-nametest/var-name
  var-value( (registeredTitle == 'false') or 
((registeredTitle == 'true') and (*this* != null)) )/var-value
  /var
  /field 

Richard Gundersen
Java Developer
 
Email: [EMAIL PROTECTED]
Phone: 01618302398
Fax: 01618342536
London Scottish Bank plc
24 Mount Street
Manchester
M2 3LS

-Original Message-
From: Pablo Vázquez Blázquez [mailto:[EMAIL PROTECTED] 
Sent: Friday, September 07, 2007 12:30 PM
To: user@struts.apache.org
Subject: Requiredif validator

Hi all!

I´m trying to validate two fields that depends on another field.

What I was doing in S1 is (for field in):

field property=in depends=requiredif
msg name=validwhen 
key=ErrorMessages.applicationIdRepresent.sameReference/
arg position=0 key=ProcessorHTTPDetails.in/
msg name=mask key=ProcessorHTTPDetails.in.help/
var
 var-namefield[0]/var-name
var-valueeditParams/var-value
/var
var
var-namefieldTest[0]/var-name
var-valueNOTNULL/var-value
/var
/field

But now in S2, there is no requiredif validator :(

Any idea about how can I do to get the same validation effect?

Thanks.



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


__
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email 
__

*** Disclaimer *** 

This electronic communication is confidential and for the exclusive use of the 
addressee. It may contain private and confidential information. The 
information, attachments and opinions contained in this E-mail are those of its 
author only and do not necessarily represent those of London Scottish Bank PLC 
or any other members of the London Scottish Group. 

If you are not the intended addressee, you are prohibited from any disclosure, 
distribution or further copying or use of this communication or the information 
in it or taking any action in reliance on it. If you have received this 
communication in error please notify the Information Security Manager at [EMAIL 
PROTECTED] as soon as possible and delete the message from all places in your 
computer where it is stored. 

We utilise virus scanning software but we cannot guarantee the security of 
electronic communications and you are advised to check any attachments for 
viruses. We do not accept liability for any loss resulting from any corruption 
or alteration of data or importation of any virus as a result of receiving this 
electronic communication. 

Replies to this E-mail may be monitored for operational or business reasons. 
London Scottish Bank PLC is regulated by the Financial Services Authority.
__
This email has been scanned by the MessageLabs Email Security System.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Requiredif validator

2007-09-07 Thread Pablo Vázquez Blázquez

Hi Richard,

Looking at http://struts.apache.org/2.x/docs/validation.html I don´t see 
there was validwhen validator...
Besides that, the example you gave me is for Struts 1, isn´t it? I need 
an Strut2 one.


Thanks.

Gundersen, Richard escribió:

Hi Pablo

Try using validwhen instead - I think rewquiredif was deprecated. I changed all mine and you can achive the same thing although your logic might have to be turned around a bit. 


Here's an example:

form name=completionForm extends=commonBankForm
  field property=registeredTitle depends=required
  arg key=completion.registered.title/
  /field
  field property=titleNo depends=validwhen
  arg key=completion.title.no/
  var
  var-nametest/var-name
  var-value( (registeredTitle == 'false') or 
((registeredTitle == 'true') and (*this* != null)) )/var-value
  /var
  /field 


Richard Gundersen
Java Developer
 
Email: [EMAIL PROTECTED]

Phone: 01618302398
Fax: 01618342536
London Scottish Bank plc
24 Mount Street
Manchester
M2 3LS

-Original Message-
From: Pablo Vázquez Blázquez [mailto:[EMAIL PROTECTED] 
Sent: Friday, September 07, 2007 12:30 PM

To: user@struts.apache.org
Subject: Requiredif validator

Hi all!

I´m trying to validate two fields that depends on another field.

What I was doing in S1 is (for field in):

field property=in depends=requiredif
msg name=validwhen 
key=ErrorMessages.applicationIdRepresent.sameReference/

arg position=0 key=ProcessorHTTPDetails.in/
msg name=mask key=ProcessorHTTPDetails.in.help/
var
 var-namefield[0]/var-name
var-valueeditParams/var-value
/var
var
var-namefieldTest[0]/var-name
var-valueNOTNULL/var-value
/var
/field

But now in S2, there is no requiredif validator :(

Any idea about how can I do to get the same validation effect?

Thanks.



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


__
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email 
__


*** Disclaimer *** 

This electronic communication is confidential and for the exclusive use of the addressee. It may contain private and confidential information. The information, attachments and opinions contained in this E-mail are those of its author only and do not necessarily represent those of London Scottish Bank PLC or any other members of the London Scottish Group. 

If you are not the intended addressee, you are prohibited from any disclosure, distribution or further copying or use of this communication or the information in it or taking any action in reliance on it. If you have received this communication in error please notify the Information Security Manager at [EMAIL PROTECTED] as soon as possible and delete the message from all places in your computer where it is stored. 

We utilise virus scanning software but we cannot guarantee the security of electronic communications and you are advised to check any attachments for viruses. We do not accept liability for any loss resulting from any corruption or alteration of data or importation of any virus as a result of receiving this electronic communication. 


Replies to this E-mail may be monitored for operational or business reasons. 
London Scottish Bank PLC is regulated by the Financial Services Authority.
__
This email has been scanned by the MessageLabs Email Security System.

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



requiredif help?

2006-10-10 Thread Mallik

HI friends 
In my form, i have to validate two fields,if another check box is not
selected, 

means if the user checked no lunch break,lunch from and lunch to are not
required,else both are monadatory. 

i hope requiredif suits for this, if so, give me some sample code or any
artical for this 

or is there any better solution for this,help for that 

ur's
Mallik


-- 
View this message in context: 
http://www.nabble.com/requiredif-help--tf2414782.html#a6731043
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: requiredif help?

2006-10-10 Thread Strachan, Paul
try using validwhen - something like:

field property=lunchFrom depends=validwhen
  arg key=Lunch from resource=false/
  var
var-nametest/var-name
var-value((lunchBreak == 'N') or (*this* != null))/var-value
  /var
/field

field property=lunchTo depends=validwhen
  arg key=Lunch to resource=false/
  var
var-nametest/var-name
var-value((lunchBreak == 'N') or (*this* != null))/var-value
  /var
/field




-Original Message-
From: Mallik [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, 10 October 2006 4:49 PM
To: user@struts.apache.org
Subject: requiredif help?


HI friends 
In my form, i have to validate two fields,if another check box is not
selected, 

means if the user checked no lunch break,lunch from and lunch to are not
required,else both are monadatory. 

i hope requiredif suits for this, if so, give me some sample code or any
artical for this 

or is there any better solution for this,help for that 

ur's
Mallik


-- 
View this message in context:
http://www.nabble.com/requiredif-help--tf2414782.html#a6731043
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

**
This message is intended for the addressee named and may contain
privileged information or confidential information or both. If you
are not the intended recipient please delete it and notify the sender.
**

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: requiredif help?

2006-10-10 Thread Mallik

Thank you friend
no i got some idea, i hope it will work
ur's
Mallik

-- 
View this message in context: 
http://www.nabble.com/requiredif-help--tf2414782.html#a6731806
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: requiredif help?

2006-10-10 Thread Mallik

html:option value=14:3514:35/html:option

html:option value=14:4014:40/html:option

html:option value=14:4514:45/html:option

html:option value=14:5014:50/html:option

html:option value=14:5514:55/html:option

html:option value=15:0015:00/html:option

/html:select

/td
  /tr

-
if the user check noLunch he no need to give any details for lunchFrom
and lunchTo, if not she should give 
let me know how to meet that need 
ur's
Mallik
-- 
View this message in context: 
http://www.nabble.com/requiredif-help--tf2414782.html#a6734975
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: requiredif help?

2006-10-10 Thread Strachan, Paul
try: var-value((lunchBreak == null) or (*this* != null))/var-value

above may work better for checkboxes which do not submit a value when
unchecked...

Some handy points about validwhen:
1. use it in place of required
2. I often come up with a invalidwhen logic and then reverse it for
validwhen

e.g. 
1. lunch from is invalid if:  (lunchFrom == null and lunchbreak != null)

now turn it around...

2. lunch from is valid if:  (lunchFrom != null or lunchbreak == null)

Hope that helps
Paul

-Original Message-
From: Strachan, Paul [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, 10 October 2006 4:58 PM
To: Struts Users Mailing List
Subject: RE: requiredif help?

try using validwhen - something like:

field property=lunchFrom depends=validwhen
  arg key=Lunch from resource=false/
  var
var-nametest/var-name
var-value((lunchBreak == 'N') or (*this* != null))/var-value
  /var
/field

field property=lunchTo depends=validwhen
  arg key=Lunch to resource=false/
  var
var-nametest/var-name
var-value((lunchBreak == 'N') or (*this* != null))/var-value
  /var
/field


-Original Message-
From: Mallik [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, 10 October 2006 4:49 PM
To: user@struts.apache.org
Subject: requiredif help?


HI friends 
In my form, i have to validate two fields,if another check box is not
selected, 

means if the user checked no lunch break,lunch from and lunch to are not
required,else both are monadatory. 

i hope requiredif suits for this, if so, give me some sample code or any
artical for this 

or is there any better solution for this,help for that 

ur's
Mallik


-- 
View this message in context:
http://www.nabble.com/requiredif-help--tf2414782.html#a6731043
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

**
This message is intended for the addressee named and may contain
privileged information or confidential information or both. If you
are not the intended recipient please delete it and notify the sender.
**

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

**
This message is intended for the addressee named and may contain
privileged information or confidential information or both. If you
are not the intended recipient please delete it and notify the sender.
**

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Valdator - RequiredIf doesn't work for IE

2006-07-19 Thread mosho

Hi all,

I am using struts 1.1 version. I have set up validator framework. 

I am using requiredIf rule, it works perfectly in Mozilla Firefox but it
doesn't work in Internet Explorer version 6.0. Is there any reason for it?
Is it not supported on IE.

Thanks


-- 
View this message in context: 
http://www.nabble.com/Valdator---RequiredIf-doesn%27t-work-for-IE-tf1968272.html#a5402491
Sent from the Struts - User forum at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Valdator - RequiredIf doesn't work for IE

2006-07-19 Thread Adam Gordon
The problem isn't technically due to the requiredIf tag but rather the
client-side Javascript that is generated by Struts to do the requiredIf
validation.  My guess is that you are experiencing one of the many problems
that arise when there are standards related issues with what MS supports vs.
what the rest of the world supports.  This becomes VERY obvious in web
development.

I believe the quote is The nice thing about standards is that there are so
many to choose from. 

Ok, so that doesn't really help you.  Since the requiredIf tag is deprecated
(and the docs say to use validwhen) I would do that or implement the
validate(...) method in your bean (just make sure you call
super.validate(...) if you want to get any other validation error messages
for rules defined in your XML.

Alternatively, you can use the Javascript debugger in IE to find out where
the error is and try to fix it yourself.

-Adam

-Original Message-
From: mosho [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, 19 July 2006 13:10
To: user@struts.apache.org
Subject: Valdator - RequiredIf doesn't work for IE


Hi all,

I am using struts 1.1 version. I have set up validator framework. 

I am using requiredIf rule, it works perfectly in Mozilla Firefox but it
doesn't work in Internet Explorer version 6.0. Is there any reason for it?
Is it not supported on IE.

Thanks


-- 
View this message in context:
http://www.nabble.com/Valdator---RequiredIf-doesn%27t-work-for-IE-tf1968272.
html#a5402491
Sent from the Struts - User forum at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: Valdator - RequiredIf doesn't work for IE

2006-07-19 Thread mosho


Thanks Adam. I got it working now
-- 
View this message in context: 
http://www.nabble.com/Valdator---RequiredIf-doesn%27t-work-for-IE-tf1968272.html#a5403936
Sent from the Struts - User forum at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Validator - requiredif validation query

2005-10-18 Thread Ashutosh Satyam
Hi,
 Is there a way to perform 'requiredif' validation on nested objects ?
 I would like to check for the value of an object only if the object 
 containing 
 it is not null.
 
 In the following example scenario:
 
 Class A{
   String x;
   String y;
 }
 
 Class Obj{
   A sub1;
   String sub2;
 }
 
 I need to validate an object of class Obj based on the rule that 'If sub1 is 
 not null 
 then sub1.x should be not null, and if sub1 is null, then do not check for 
 sub1.x' 
 
The validator.xml is: 

 form  
 .
 field property=sub1.x depends=requiredif
   var   
   var-namefield[0]/var-name
   var-valuesub1/var-value
   /var
   var   
   var-namefieldTest[0]/var-name
   var-valueNOTNULL/var-value
   /var
 
 /field  
 ...
 /form   
 
 However, this does not seem to work, and fails when sub1 is null. It throws 
 an 
 exception when trying to retrieve sub1.x value. 
 
 Is there any way to perform such a validation ?
 
 
 
 Thanks and Regards,
Ashutosh



Re: Validator - requiredif validation query

2005-10-18 Thread Kishore Senji
May be you could use validWhen. I'm not sure if this works, may be you
could give it a try

field property=sub1 depends=validWhen
var
var-nametest/var-name
var-value((*this*==null) or ((*this*!=null) and (sub1.x!=null
)))/var-value
/var
/field


On 10/18/05, Ashutosh Satyam [EMAIL PROTECTED] wrote:

 Hi,
  Is there a way to perform 'requiredif' validation on nested objects ?
  I would like to check for the value of an object only if the object
 containing
  it is not null.
 
  In the following example scenario:
 
  Class A{
  String x;
  String y;
  }
 
  Class Obj{
  A sub1;
  String sub2;
  }
 
  I need to validate an object of class Obj based on the rule that 'If
 sub1 is not null
  then sub1.x should be not null, and if sub1 is null, then do not check
 for sub1.x'
 
 The validator.xml is:

  form  
  .
  field property=sub1.x depends=requiredif
  var
  var-namefield[0]/var-name
  var-valuesub1/var-value
  /var
  var
  var-namefieldTest[0]/var-name
  var-valueNOTNULL/var-value
  /var
 
  /field
  ...
  /form
 
  However, this does not seem to work, and fails when sub1 is null. It
 throws an
  exception when trying to retrieve sub1.x value.
 
  Is there any way to perform such a validation ?
 
 
 
  Thanks and Regards,
 Ashutosh





RE: requiredif

2005-04-23 Thread tarek.nabil
Hi Erik,

Actually, I do have a more complicated scenario. I tried your idea using
JavaScript to set the action and it worked perfectly. Thanks a lot.

-Original Message-
From: Erik Weber [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, April 20, 2005 12:51 PM
To: Struts Users Mailing List
Subject: Re: requiredif



tarek.nabil wrote:

Thanks Erik.

I like the idea of using the same action with different URLs but how do

you do that? The only way I can think of is changing the action of the 
form when clicking any of the buttons using JavaScript, is that what 
you meant?
  


Well that is a common way to do it. I was thinking of the typical case
of add vs. update -- two actions that could share the same page,
ActionForm and Action. Here you don't need JavaScript. There are two GET
requests for the page, something like /controller/viewAdd and
/controller/viewUpdate. When the user requests the add page, you set
the form action to /controller/saveAdd, and when the user requests the
update page, you set the form action to /controller/saveUpdate, or
something like that, dynamically:

html:form action=${action} focus=foo

However, it sounds like you have a more complicated scenario, so I don't
know whether you would be forced to change the action URL with
JavaScript in your case.

Erik

Actually, for our client, clientside validations are more important 
than server-side ones. The reason I'm doing server-side validations is 
that I know that client-side validations can be circumvented and I 
don't want that to cause an error screen to appear.

As for  validwhen, I think it's worth giving it a shot to see if it can

be plugged in as a custom validator.

-Original Message-
From: Erik Weber [mailto:[EMAIL PROTECTED]
Sent: Wednesday, April 20, 2005 8:50 AM
To: Struts Users Mailing List
Subject: Re: requiredif



tarek.nabil wrote:

  

Hi Erik,

Actually after some reasoning about the application I came to a 
conclusion that I will not use the integration between Struts and the 
Validator framework. I might still use the ready made validators, but 
I



  

will call them explicitly.
 




Yeah don't forget that you can still use the Validator plugin on the 
server side, even if you don't use the Validator brand of ActionForms.
See Rick Reumann's site for examples of this (if I'm not mistaken; I 
know he uses this technique).

  

The reason is, the pages in the application are designed to do search,

add, edit and delete functionalities in the same page. We do this 
using



  

the same form, and the button the user presses is what determines the 
operation. This makes all the validations kind of conditional. For 
example, the id will be mandatory if you're deleting but the name will

be mandatory if you're adding and so on. As a result, to support this,

I will have to declare all my required validations using requiredif 
since usually most validations depend on required.
 




Well, there is an easy way to conquer this problem -- you just use 
multiple action mappings for the same Action that use the same 
ActionForm. All you need is a different URL then. Each action mapping 
has a different name (an alias to the same ActionForm) -- triggering a 
different section of your validation.xml file to be used for
validation.

This way you can validate only the fields required for the given use 
case, and yet you have a single Action and a single ActionForm, and 
even a single form JSP. Have you considered this?


  

Since requiredif does not have a clientside script part, that means I 
will only benefit from server side validation, that's problem number 
one.




But client side validation is only a luxury for the user while server 
side validation is mandatory, so I don't understand your statement
here.

  

Problem number two is that declaring all required validations as 
requiredif will be very time consuming, since the syntax for 
requiredif



  

is a bit awkward and very verbose. Adding the fact that requiredif is 
not supported in the version I'm using makes the integration almost 
meaningless. As you see, no clientside, time consuming simple 
validations and above all, it's not currently working. That led me to 
the decision to just write my own validation code in the validate 
method.
 




I'm really confused about what you are trying to do here. requiredif is

for a case where, for example, you have a drop down box paired with a 
text field. You only want the text field value to be validated if the 
drop down box value is equal to foo. Are you trying to use it to 
accomplish something else? (Like what I describe in my second
paragraph?)

  

The only thing that would make me change my mind is if I were able to 
use validwhen with 1.1b2. Only then will this make sense, although 
even



  

in this case I would still have to write my own clientside
validations.
Or wouldn't I? Depends on whether validwhen generates javascript for 
clientside validation. Does it do

RE: requiredif

2005-04-20 Thread tarek.nabil
Thanks Erik.

I like the idea of using the same action with different URLs but how do
you do that? The only way I can think of is changing the action of the
form when clicking any of the buttons using JavaScript, is that what you
meant?

Actually, for our client, clientside validations are more important than
server-side ones. The reason I'm doing server-side validations is that I
know that client-side validations can be circumvented and I don't want
that to cause an error screen to appear.

As for  validwhen, I think it's worth giving it a shot to see if it can
be plugged in as a custom validator.

-Original Message-
From: Erik Weber [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, April 20, 2005 8:50 AM
To: Struts Users Mailing List
Subject: Re: requiredif



tarek.nabil wrote:

Hi Erik,

Actually after some reasoning about the application I came to a 
conclusion that I will not use the integration between Struts and the 
Validator framework. I might still use the ready made validators, but I

will call them explicitly.
  


Yeah don't forget that you can still use the Validator plugin on the
server side, even if you don't use the Validator brand of ActionForms. 
See Rick Reumann's site for examples of this (if I'm not mistaken; I
know he uses this technique).

The reason is, the pages in the application are designed to do search, 
add, edit and delete functionalities in the same page. We do this using

the same form, and the button the user presses is what determines the 
operation. This makes all the validations kind of conditional. For 
example, the id will be mandatory if you're deleting but the name will 
be mandatory if you're adding and so on. As a result, to support this, 
I will have to declare all my required validations using requiredif 
since usually most validations depend on required.
  


Well, there is an easy way to conquer this problem -- you just use
multiple action mappings for the same Action that use the same
ActionForm. All you need is a different URL then. Each action mapping
has a different name (an alias to the same ActionForm) -- triggering a
different section of your validation.xml file to be used for validation.

This way you can validate only the fields required for the given use
case, and yet you have a single Action and a single ActionForm, and even
a single form JSP. Have you considered this?


Since requiredif does not have a clientside script part, that means I 
will only benefit from server side validation, that's problem number 
one.


But client side validation is only a luxury for the user while server
side validation is mandatory, so I don't understand your statement here.

Problem number two is that declaring all required validations as 
requiredif will be very time consuming, since the syntax for requiredif

is a bit awkward and very verbose. Adding the fact that requiredif is 
not supported in the version I'm using makes the integration almost 
meaningless. As you see, no clientside, time consuming simple 
validations and above all, it's not currently working. That led me to 
the decision to just write my own validation code in the validate 
method.
  


I'm really confused about what you are trying to do here. requiredif is
for a case where, for example, you have a drop down box paired with a
text field. You only want the text field value to be validated if the
drop down box value is equal to foo. Are you trying to use it to
accomplish something else? (Like what I describe in my second
paragraph?)

The only thing that would make me change my mind is if I were able to 
use validwhen with 1.1b2. Only then will this make sense, although even

in this case I would still have to write my own clientside validations.
Or wouldn't I? Depends on whether validwhen generates javascript for 
clientside validation. Does it do that? And do you think this is 
possible?
  


I won't comment on the client side validation, because I don't use it. 
The only client side validation I tend to use (if at all) is a blank
field check when the form happens to be very large, unless of course my
customer wants something else. If the customer wants something else, I
give him a desktop application. :)

I also don't know about retrofitting validwhen for 1.1, but again, the
idea arises that perhaps you could embed validwhen (or something just
like it) as a custom validator? Does the version of Struts you are using
support custom validators?

Hope that helps,

Erik

Thanks

-Original Message-
From: Erik Weber [mailto:[EMAIL PROTECTED]
Sent: Tuesday, April 19, 2005 7:54 PM
To: Struts Users Mailing List
Subject: Re: requiredif

Oh, I'm sorry. I pulled that from the last release of 1.1. Zoinks, you 
are stuck with a pre-1.1 version? Perhaps you could write a custom 
validator plugin that basically does the same thing?

tarek.nabil wrote:

  

Hi Erik,

I tried it and it didn't work. I checked out the validator and struts 
jar files and it turned out

Re: requiredif

2005-04-20 Thread Erik Weber

tarek.nabil wrote:
Thanks Erik.
I like the idea of using the same action with different URLs but how do
you do that? The only way I can think of is changing the action of the
form when clicking any of the buttons using JavaScript, is that what you
meant?
 

Well that is a common way to do it. I was thinking of the typical case 
of add vs. update -- two actions that could share the same page, 
ActionForm and Action. Here you don't need JavaScript. There are two GET 
requests for the page, something like /controller/viewAdd and 
/controller/viewUpdate. When the user requests the add page, you set 
the form action to /controller/saveAdd, and when the user requests the 
update page, you set the form action to /controller/saveUpdate, or 
something like that, dynamically:

html:form action=${action} focus=foo
However, it sounds like you have a more complicated scenario, so I don't 
know whether you would be forced to change the action URL with 
JavaScript in your case.

Erik
Actually, for our client, clientside validations are more important than
server-side ones. The reason I'm doing server-side validations is that I
know that client-side validations can be circumvented and I don't want
that to cause an error screen to appear.
As for  validwhen, I think it's worth giving it a shot to see if it can
be plugged in as a custom validator.
-Original Message-
From: Erik Weber [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, April 20, 2005 8:50 AM
To: Struts Users Mailing List
Subject: Re: requiredif


tarek.nabil wrote:
 

Hi Erik,
Actually after some reasoning about the application I came to a 
conclusion that I will not use the integration between Struts and the 
Validator framework. I might still use the ready made validators, but I
   

 

will call them explicitly.
   

Yeah don't forget that you can still use the Validator plugin on the
server side, even if you don't use the Validator brand of ActionForms. 
See Rick Reumann's site for examples of this (if I'm not mistaken; I
know he uses this technique).

 

The reason is, the pages in the application are designed to do search, 
add, edit and delete functionalities in the same page. We do this using
   

 

the same form, and the button the user presses is what determines the 
operation. This makes all the validations kind of conditional. For 
example, the id will be mandatory if you're deleting but the name will 
be mandatory if you're adding and so on. As a result, to support this, 
I will have to declare all my required validations using requiredif 
since usually most validations depend on required.

   

Well, there is an easy way to conquer this problem -- you just use
multiple action mappings for the same Action that use the same
ActionForm. All you need is a different URL then. Each action mapping
has a different name (an alias to the same ActionForm) -- triggering a
different section of your validation.xml file to be used for validation.
This way you can validate only the fields required for the given use
case, and yet you have a single Action and a single ActionForm, and even
a single form JSP. Have you considered this?
 

Since requiredif does not have a clientside script part, that means I 
will only benefit from server side validation, that's problem number 
one.

   

But client side validation is only a luxury for the user while server
side validation is mandatory, so I don't understand your statement here.
 

Problem number two is that declaring all required validations as 
requiredif will be very time consuming, since the syntax for requiredif
   

 

is a bit awkward and very verbose. Adding the fact that requiredif is 
not supported in the version I'm using makes the integration almost 
meaningless. As you see, no clientside, time consuming simple 
validations and above all, it's not currently working. That led me to 
the decision to just write my own validation code in the validate 
method.

   

I'm really confused about what you are trying to do here. requiredif is
for a case where, for example, you have a drop down box paired with a
text field. You only want the text field value to be validated if the
drop down box value is equal to foo. Are you trying to use it to
accomplish something else? (Like what I describe in my second
paragraph?)
 

The only thing that would make me change my mind is if I were able to 
use validwhen with 1.1b2. Only then will this make sense, although even
   

 

in this case I would still have to write my own clientside validations.
Or wouldn't I? Depends on whether validwhen generates javascript for 
clientside validation. Does it do that? And do you think this is 
possible?

   

I won't comment on the client side validation, because I don't use it. 
The only client side validation I tend to use (if at all) is a blank
field check when the form happens to be very large, unless of course my
customer wants something else. If the customer wants something else, I
give him a desktop application. :)

I also don't

requiredif

2005-04-19 Thread tarek.nabil
Hi,

I'm stuck with Struts 1.1b2 and I need to do some conditional
validation. AFAIK, the way to do this for this version is using the
requiredif validator. The problem is, I cannot find any reference
information on how to add this validator to the validator-rules.xml
configuration file.

Please advise on how to do this and if there's a better way to do this
with this old version. For example, is it possible to configure the old
Struts/Validator versions to use validwhen?

Any help is appreciated.

Tarek Nabil


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: requiredif

2005-04-19 Thread Erik Weber
   !-- requiredif --
   validator name=requiredif
 classname=org.apache.struts.validator.FieldChecks
method=validateRequiredIf
  methodParams=java.lang.Object,
org.apache.commons.validator.ValidatorAction,
org.apache.commons.validator.Field,
org.apache.struts.action.ActionErrors,
org.apache.commons.validator.Validator,
javax.servlet.http.HttpServletRequest
   msg=errors.required/
Erik
tarek.nabil wrote:
Hi,
I'm stuck with Struts 1.1b2 and I need to do some conditional
validation. AFAIK, the way to do this for this version is using the
requiredif validator. The problem is, I cannot find any reference
information on how to add this validator to the validator-rules.xml
configuration file.
Please advise on how to do this and if there's a better way to do this
with this old version. For example, is it possible to configure the old
Struts/Validator versions to use validwhen?
Any help is appreciated.
Tarek Nabil
-
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]


RE: requiredif

2005-04-19 Thread tarek.nabil
Thanks Erik.

I was wondering, is there a client side JavaScript part?

Also, is it possible to use validwhen with the old versions of struts
(1.1b2).

Thanks for your help.

-Original Message-
From: Erik Weber [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, April 19, 2005 3:24 PM
To: Struts Users Mailing List
Subject: Re: requiredif


!-- requiredif --
validator name=requiredif
  classname=org.apache.struts.validator.FieldChecks
 method=validateRequiredIf
   methodParams=java.lang.Object,
 
org.apache.commons.validator.ValidatorAction,
 org.apache.commons.validator.Field,
 org.apache.struts.action.ActionErrors,
 org.apache.commons.validator.Validator,
 javax.servlet.http.HttpServletRequest
msg=errors.required/


Erik


tarek.nabil wrote:

Hi,

I'm stuck with Struts 1.1b2 and I need to do some conditional 
validation. AFAIK, the way to do this for this version is using the 
requiredif validator. The problem is, I cannot find any reference 
information on how to add this validator to the validator-rules.xml 
configuration file.

Please advise on how to do this and if there's a better way to do this 
with this old version. For example, is it possible to configure the old

Struts/Validator versions to use validwhen?

Any help is appreciated.

Tarek Nabil


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



RE: requiredif

2005-04-19 Thread tarek.nabil
 Hi Erik,

I tried it and it didn't work. I checked out the validator and struts
jar files and it turned out that the
org.apache.struts.validator.FieldChecks class does not exist in either
of them. Is it possible that it was introduced after 1.1b2? I'm sure
it's in RC1 because I'm using the documentation shipped in 1.1RC1.

Thanks again for your help.

-Original Message-
From: tarek.nabil 
Sent: Tuesday, April 19, 2005 7:41 PM
To: Struts Users Mailing List
Subject: RE: requiredif

Thanks Erik.

I was wondering, is there a client side JavaScript part?

Also, is it possible to use validwhen with the old versions of struts
(1.1b2).

Thanks for your help.

-Original Message-
From: Erik Weber [mailto:[EMAIL PROTECTED]
Sent: Tuesday, April 19, 2005 3:24 PM
To: Struts Users Mailing List
Subject: Re: requiredif


!-- requiredif --
validator name=requiredif
  classname=org.apache.struts.validator.FieldChecks
 method=validateRequiredIf
   methodParams=java.lang.Object,
 
org.apache.commons.validator.ValidatorAction,
 org.apache.commons.validator.Field,
 org.apache.struts.action.ActionErrors,
 org.apache.commons.validator.Validator,
 javax.servlet.http.HttpServletRequest
msg=errors.required/


Erik


tarek.nabil wrote:

Hi,

I'm stuck with Struts 1.1b2 and I need to do some conditional 
validation. AFAIK, the way to do this for this version is using the 
requiredif validator. The problem is, I cannot find any reference 
information on how to add this validator to the validator-rules.xml 
configuration file.

Please advise on how to do this and if there's a better way to do this 
with this old version. For example, is it possible to configure the old

Struts/Validator versions to use validwhen?

Any help is appreciated.

Tarek Nabil


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



Re: requiredif

2005-04-19 Thread Erik Weber
Oh, I'm sorry. I pulled that from the last release of 1.1. Zoinks, you 
are stuck with a pre-1.1 version? Perhaps you could write a custom 
validator plugin that basically does the same thing?

tarek.nabil wrote:
Hi Erik,
I tried it and it didn't work. I checked out the validator and struts
jar files and it turned out that the
org.apache.struts.validator.FieldChecks class does not exist in either
of them. Is it possible that it was introduced after 1.1b2? I'm sure
it's in RC1 because I'm using the documentation shipped in 1.1RC1.
Thanks again for your help.
-Original Message-
From: tarek.nabil 
Sent: Tuesday, April 19, 2005 7:41 PM
To: Struts Users Mailing List
Subject: RE: requiredif

Thanks Erik.
I was wondering, is there a client side JavaScript part?
Also, is it possible to use validwhen with the old versions of struts
(1.1b2).
Thanks for your help.
-Original Message-
From: Erik Weber [mailto:[EMAIL PROTECTED]
Sent: Tuesday, April 19, 2005 3:24 PM
To: Struts Users Mailing List
Subject: Re: requiredif
   !-- requiredif --
   validator name=requiredif
 classname=org.apache.struts.validator.FieldChecks
method=validateRequiredIf
  methodParams=java.lang.Object,
org.apache.commons.validator.ValidatorAction,
org.apache.commons.validator.Field,
org.apache.struts.action.ActionErrors,
org.apache.commons.validator.Validator,
javax.servlet.http.HttpServletRequest
   msg=errors.required/
Erik
tarek.nabil wrote:
 

Hi,
I'm stuck with Struts 1.1b2 and I need to do some conditional 
validation. AFAIK, the way to do this for this version is using the 
requiredif validator. The problem is, I cannot find any reference 
information on how to add this validator to the validator-rules.xml 
configuration file.

Please advise on how to do this and if there's a better way to do this 
with this old version. For example, is it possible to configure the old
   

 

Struts/Validator versions to use validwhen?
Any help is appreciated.
Tarek Nabil
-
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]
 

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: requiredif

2005-04-19 Thread Erik Weber

tarek.nabil wrote:
Hi Erik,
Actually after some reasoning about the application I came to a
conclusion that I will not use the integration between Struts and the
Validator framework. I might still use the ready made validators, but I
will call them explicitly.
 

Yeah don't forget that you can still use the Validator plugin on the 
server side, even if you don't use the Validator brand of ActionForms. 
See Rick Reumann's site for examples of this (if I'm not mistaken; I 
know he uses this technique).

The reason is, the pages in the application are designed to do search,
add, edit and delete functionalities in the same page. We do this using
the same form, and the button the user presses is what determines the
operation. This makes all the validations kind of conditional. For
example, the id will be mandatory if you're deleting but the name will
be mandatory if you're adding and so on. As a result, to support this, I
will have to declare all my required validations using requiredif since
usually most validations depend on required.
 

Well, there is an easy way to conquer this problem -- you just use 
multiple action mappings for the same Action that use the same 
ActionForm. All you need is a different URL then. Each action mapping 
has a different name (an alias to the same ActionForm) -- triggering a 
different section of your validation.xml file to be used for validation. 
This way you can validate only the fields required for the given use 
case, and yet you have a single Action and a single ActionForm, and even 
a single form JSP. Have you considered this?

Since requiredif does not have a clientside script part, that means I
will only benefit from server side validation, that's problem number
one. 

But client side validation is only a luxury for the user while server 
side validation is mandatory, so I don't understand your statement here.

Problem number two is that declaring all required validations as
requiredif will be very time consuming, since the syntax for requiredif
is a bit awkward and very verbose. Adding the fact that requiredif is
not supported in the version I'm using makes the integration almost
meaningless. As you see, no clientside, time consuming simple
validations and above all, it's not currently working. That led me to
the decision to just write my own validation code in the validate
method.
 

I'm really confused about what you are trying to do here. requiredif is 
for a case where, for example, you have a drop down box paired with a 
text field. You only want the text field value to be validated if the 
drop down box value is equal to foo. Are you trying to use it to 
accomplish something else? (Like what I describe in my second paragraph?)

The only thing that would make me change my mind is if I were able to
use validwhen with 1.1b2. Only then will this make sense, although even
in this case I would still have to write my own clientside validations.
Or wouldn't I? Depends on whether validwhen generates javascript for
clientside validation. Does it do that? And do you think this is
possible?
 

I won't comment on the client side validation, because I don't use it. 
The only client side validation I tend to use (if at all) is a blank 
field check when the form happens to be very large, unless of course my 
customer wants something else. If the customer wants something else, I 
give him a desktop application. :)

I also don't know about retrofitting validwhen for 1.1, but again, the 
idea arises that perhaps you could embed validwhen (or something just 
like it) as a custom validator? Does the version of Struts you are using 
support custom validators?

Hope that helps,
Erik
Thanks
-Original Message-
From: Erik Weber [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, April 19, 2005 7:54 PM
To: Struts Users Mailing List
Subject: Re: requiredif

Oh, I'm sorry. I pulled that from the last release of 1.1. Zoinks, you
are stuck with a pre-1.1 version? Perhaps you could write a custom
validator plugin that basically does the same thing?
tarek.nabil wrote:
 

Hi Erik,
I tried it and it didn't work. I checked out the validator and struts 
jar files and it turned out that the 
org.apache.struts.validator.FieldChecks class does not exist in either 
of them. Is it possible that it was introduced after 1.1b2? I'm sure 
it's in RC1 because I'm using the documentation shipped in 1.1RC1.

Thanks again for your help.
-Original Message-
From: tarek.nabil
Sent: Tuesday, April 19, 2005 7:41 PM
To: Struts Users Mailing List
Subject: RE: requiredif
Thanks Erik.
I was wondering, is there a client side JavaScript part?
Also, is it possible to use validwhen with the old versions of struts 
(1.1b2).

Thanks for your help.
-Original Message-
From: Erik Weber [mailto:[EMAIL PROTECTED]
Sent: Tuesday, April 19, 2005 3:24 PM
To: Struts Users Mailing List
Subject: Re: requiredif
  !-- requiredif --
  validator name=requiredif
classname

Validator requiredif and range problem

2005-02-28 Thread Christopher Loschen
Hi experts!

I've got a problem where two fields are being checked for being in the valid
range when only one of them is being used at any one time. I'm using Struts
1.1 so I'm limited to using requiredif instead of validwhen (right?). I've got
some radio buttons set up like this:

input type=radio name=amountType value=upto amount
checked=checkedTotal amount with a threshold of $input type=text
name=amount size=5 value=9br /
(you will be notified by e-mail if amount exceeds desired threshold)br /
input type=radio name=amountType value=fixed amountFixed Amount of $
input type=text name=fixedAmount size=5 value=0.0

and my validation.xml looks like this:

field property=amount depends=requiredif,floatRange
arg0 key=ui.payment.recurringpay.amount/
arg1 name=floatRange key=${var:min} resource=false/
arg2 name=floatRange key=${var:max} resource=false/
msg name=float key=ui.payment.recurringpay.error.Amount/
var
var-namefield[0]/var-name
var-valueamountType/var-value
/var
var
var-namefieldTest[0]/var-name
var-valueEQUAL/var-value
/var
var
var-namefieldValue[0]/var-name
var-valueupto amount/var-value
/var
var
var-namemin/var-name
var-value0.01/var-value
/var
var
var-namemax/var-name
var-value.99/var-value
/var
/field
field property=fixedAmount depends=requiredif,floatRange
arg0 key=ui.payment.recurringpay.fixedAmount/
arg1 name=floatRange key=${var:min} resource=false/
arg2 name=floatRange key=${var:max} resource=false/
msg name=float key=ui.payment.recurringpay.error.fixedAmount/
var
var-namefield[0]/var-name
var-valueamountType/var-value
/var
var
var-namefieldTest[0]/var-name
var-valueEQUAL/var-value
/var
var
var-namefieldValue[0]/var-name
var-valuefixed amount/var-value
/var
var
var-namemin/var-name
var-value0.01/var-value
/var
var
var-namemax/var-name
var-value.99/var-value
/var
/field

This was working (I think)  before I added the floatRange parameters, although
all that would have done is check to make sure the entry isn't null.

I'm getting messages from both amount and fixedAmount, so I seem to have
broken the requiredif clause somehow, but I'm not sure how. Any suggestions?

Thanks!

Chris Loschen



   


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Validator requiredif throws java.lang.reflect.InvocationTargetException

2004-11-04 Thread Mark Benussi
Afternoon.
Have the following problem which is throwing an invocation exception which I 
assume means that a Null Pointer Exception occurred. WOuld appreciate some 
assistance as its doing my nut

Properties.
errors.requiredif = Please enter the {0} here or another required field.
customerAddressForm.buildingNumber = building number
customerAddressForm.buildingName = building name
Validator rules.
form-validation
	global
		validator name=requiredif 
classname=org.apache.struts.validator.FieldChecks 
method=validateRequiredIf 
methodParams=java.lang.Object,org.apache.commons.validator.ValidatorAction,org.apache.commons.validator.Field,org.apache.struts.action.ActionErrors,org.apache.commons.validator.Validator,javax.servlet.http.HttpServletRequest 
msg=errors.requiredif /
	/global
/form-validation

Struts validation
!-- Submitted with a customer address registration --
form name=customerAddressForm
field property=buildingName depends=requiredif
arg0 key=customerAddressForm.buildingName /
var
var-namefield[0]/var-name
var-valuebuildingNumber/var-value
/var
var
var-namefieldTest[0]/var-name
var-valueNULL/var-value
/var
/field
field property=buildingNumber depends=requiredif
arg0 key=customerAddressForm.buildingNumber /
var
var-namefield[0]/var-name
var-valuebuildingName/var-value
/var
var
var-namefieldTest[0]/var-name
var-valueNULL/var-value
/var
/field
/form
Throws the following when I enter nothing in either buildingName or 
buildingNumber
[04/11/04 16:38:21:086 GMT] 681bd507 RequestProces I 
org.apache.struts.action.RequestProcessor  Processing a 'POST' for path 
'/registration/stage2'

[04/11/04 16:38:21:086 GMT] 681bd507 Validator E 
org.apache.commons.validator.Validator  reflection: null

[04/11/04 16:38:21:096 GMT] 681bd507 Validator E 
org.apache.commons.validator.Validator  TRAS0014I: The following exception 
was logged java.lang.reflect.InvocationTargetException: 
java.lang.NullPointerException
	at 
org.apache.struts.validator.FieldChecks.validateRequiredIf(FieldChecks.java:190)
	at java.lang.reflect.Method.invoke(Native Method)
	at 
org.apache.commons.validator.Validator.validateFieldForRule(Validator.java:435)
	at org.apache.commons.validator.Validator.validateField(Validator.java:512)
	at org.apache.commons.validator.Validator.validate(Validator.java:551)
	at 
org.apache.struts.validator.ValidatorForm.validate(ValidatorForm.java:152)
	at 
org.apache.struts.action.RequestProcessor.processValidate(RequestProcessor.java:912)
	at 
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:255)
	at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1422)
	at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:523)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
	at 
com.ibm.ws.webcontainer.servlet.StrictServletInstance.doService(StrictServletInstance.java:110)
	at 
com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet._service(StrictLifecycleServlet.java:174)
	at 
com.ibm.ws.webcontainer.servlet.IdleServletState.service(StrictLifecycleServlet.java:313)
	at 
com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet.service(StrictLifecycleServlet.java:116)
	at 
com.ibm.ws.webcontainer.servlet.ServletInstance.service(ServletInstance.java:258)
	at 
com.ibm.ws.webcontainer.servlet.ValidServletReferenceState.dispatch(ValidServletReferenceState.java:42)
	at 
com.ibm.ws.webcontainer.servlet.ServletInstanceReference.dispatch(ServletInstanceReference.java:40)
	at 
com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.handleWebAppDispatch(WebAppRequestDispatcher.java:872)
	at 
com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.dispatch(WebAppRequestDispatcher.java:491)
	at 
com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.forward(WebAppRequestDispatcher.java:173)
	at 
com.ibm.ws.webcontainer.srt.WebAppInvoker.doForward(WebAppInvoker.java:79)
	at 
com.ibm.ws.webcontainer.srt.WebAppInvoker.handleInvocationHook(WebAppInvoker.java:199)
	at 
com.ibm.ws.webcontainer.cache.invocation.CachedInvocation.handleInvocation(CachedInvocation.java:71)
	at 
com.ibm.ws.webcontainer.cache.invocation.CacheableInvocationContext.invoke

Re: requiredif combined with other validation rules

2004-10-26 Thread Adam Hardy
I don't think that's surprising behaviour. It sounds like what you 
really need is a 'maskIf' test. You could possibly roll your own from 
the requiredif and mask.

On 10/25/2004 05:12 PM David Schneider wrote:
hi.  i'm using struts 1.1 and have a question about combining requiredif
with other validation rules.  i have
field property=zip depends=requiredif, mask
  msg name=requiredif key=CustomerInfoForm.zip.invalid/
  msg name=mask key=CustomerInfoForm.zip.invalid/
  var
var-namefield[0]/var-name
var-valuecountry/var-value
  /var
  var
var-namefieldTest[0]/var-name
var-valueEQUAL/var-value
  /var
  var
var-namefieldValue[0]/var-name
var-value840/var-value
  /var
  var
var-namemask/var-name
var-value${uszipmask}/var-value
  /var
  field
if a user chooses a country other than 840 (usa) and leaves the zip blank,
then the form passes validation.  however, if he chooses a country other
than 840 and enters something in the zip field then the mask is applied to
that value.  i would like the mask rule to be bypassed also if the country
isn't 840.  is this possible?

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


requiredif combined with other validation rules

2004-10-25 Thread David Schneider
hi.  i'm using struts 1.1 and have a question about combining requiredif
with other validation rules.  i have

field property=zip depends=requiredif, mask
  msg name=requiredif key=CustomerInfoForm.zip.invalid/
  msg name=mask key=CustomerInfoForm.zip.invalid/
  var
var-namefield[0]/var-name
var-valuecountry/var-value
  /var
  var
var-namefieldTest[0]/var-name
var-valueEQUAL/var-value
  /var
  var
var-namefieldValue[0]/var-name
var-value840/var-value
  /var
  var
var-namemask/var-name
var-value${uszipmask}/var-value
  /var
  field

if a user chooses a country other than 840 (usa) and leaves the zip blank,
then the form passes validation.  however, if he chooses a country other
than 840 and enters something in the zip field then the mask is applied to
that value.  i would like the mask rule to be bypassed also if the country
isn't 840.  is this possible?


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



problems using requiredif

2004-06-17 Thread Alcÿffffe1ntara
Hi,

I have some problem using requiredif, the problem is
the following:

I have 1 Dynamic form and two JSPs that send
information (these JSPs differs in any fields) two one
action, I'm trying to get that depends on the value of
one field (tipPersona = 0/1)require and mask any
fields.  this works with one field(txtRazonSocial) but
with other(codActividadEconomica) always get a mask
error.

here's the code:


field property=tipPersona depends=required,mask
arg0 key=${var:campo} resource=false
name=required /
arg0 key=${var:campo} resource=false
name=mask /
var
var-namecampo/var-name
var-valueTipo de
Persona/var-value
/var
var
var-namemask/var-name
var-value^[01]{1}$/var-value
/var
/field

field property=txtRazonSocial
depends=requiredif,mask
arg0 key=${var:campo} resource=false
name=mask /
msg name=requiredif
key=errors.required/
arg0 key=${var:campo} resource=false
name=requiredif /
var
var-namecampo/var-name
var-valueRazón
Social/var-value
/var
var
var-namemask/var-name
var-value^[a-zA-Z09
\-]{2,70}$/var-value
/var
var
var-namefield[0]/var-name
var-valuetipPersona/var-value
/var
var
var-namefieldTest[0]/var-name
var-valueEQUAL/var-value
/var
var
var-namefieldValue[0]/var-name
var-value0/var-value
/var
/field

field property=codActividadEconomica
depends=requiredif,mask   
arg0 key=${var:campo}
resource=false name=mask /
msg name=requiredif
key=errors.required/
arg0 key=${var:campo}
resource=false name=requiredif /
var
var-namefield[0]/var-name
var-valuetipPersona/var-value
/var
var
var-namefieldTest[0]/var-name
var-valueEQUAL/var-value
/var
var
var-namefieldValue[0]/var-name
var-value0/var-value
/var
var
var-namemask/var-name
var-value^[0-9]{2}$/var-value
/var
var
var-namecampo/var-name
var-valueActividad
Económica/var-value
/var
/field
field property=txtApellidoMaterno
depends=requiredif,mask
arg0 key=${var:campo} resource=false
name=mask /
msg name=requiredif
key=errors.required/
arg0 key=${var:campo} resource=false
name=requiredif /
var
var-namecampo/var-name
var-valueApellido
Materno/var-value
/var
var
var-namemask/var-name
var-value^[a-zA-Z
\-]{2,30}$/var-value
/var
var
var-namefield[0]/var-name
var-valuetipPersona/var-value
/var
var
var-namefieldTest[0]/var-name
var-valueEQUAL/var-value
/var
var
var-namefieldValue[0]/var-name
var-value1/var-value
/var
/field

Inside JSP I only have the properties that are
validated when the value of tipPersona=1, I didn't the
other page because i want to be sure that it works.

__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RequiredIf Validator Doesn't Seem To Work With Nested Properties

2004-06-02 Thread Nifty Music
Howdy!

I'm just wondering if anyone has run across this issue and if so, is there a 
workaround?  It appears that the requiredif validator does not work correctly when 
using nested properties.  Here's my XML:

field property=proofNumber
depends=requiredif,mask page=1
msg name=mask key=placard.errors.physiciansNumber/   
 
arg0   key=placard.label.physiciansNumber/
var
var-namefield[0]/var-name
var-valueownerDEO.uniqueIdType/var-value
/var
var
var-namefieldTest[0]/var-name
var-valueEQUAL/var-value
/var
var
var-namefieldValue[0]/var-name
var-valueB/var-value
/var
var
var-namefield[1]/var-name
var-valueproofType/var-value
/var
var
var-namefieldTest[1]/var-name
var-valueEQUAL/var-value
/var
var
var-namefieldValue[1]/var-name
var-valueP/var-value
/var
var
var-namefieldJoin/var-name
var-valueAND/var-value
/var  
var
var-namemask/var-name
var-value^\d{5}|\d{6}|\d{10}$/var-value
/var
/field

When I had it coded such that the owner.uniqueId was not a nested property (i.e. 
merely uniqueId), this validation worked perfectly.  Now, however, no matter what is 
entered, the system throws an error.  Is there a different syntax that I need to use 
or is this just a bug?

Thanks!

Brent


This message sent using iMail from I-Land Internet Services.
http://www.iland.net 


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RequiredIf Validator Doesn't Seem To Work With Nested Properties

2004-06-02 Thread Nifty Music
Howdy!

I'm just wondering if anyone has run across this issue and if so, is there a 
workaround?  It appears that the requiredif validator does not work correctly when 
using nested properties.  Here's my XML:

field property=proofNumber
depends=requiredif,mask page=1
msg name=mask key=placard.errors.physiciansNumber/   
 
arg0   key=placard.label.physiciansNumber/
var
var-namefield[0]/var-name
var-valueownerDEO.uniqueIdType/var-value
/var
var
var-namefieldTest[0]/var-name
var-valueEQUAL/var-value
/var
var
var-namefieldValue[0]/var-name
var-valueB/var-value
/var
var
var-namefield[1]/var-name
var-valueproofType/var-value
/var
var
var-namefieldTest[1]/var-name
var-valueEQUAL/var-value
/var
var
var-namefieldValue[1]/var-name
var-valueP/var-value
/var
var
var-namefieldJoin/var-name
var-valueAND/var-value
/var  
var
var-namemask/var-name
var-value^\d{5}|\d{6}|\d{10}$/var-value
/var
/field

When I had it coded such that the owner.uniqueId was not a nested property (i.e. 
merely uniqueId), this validation worked perfectly.  Now, however, no matter what is 
entered, the system throws an error.  Is there a different syntax that I need to use 
or is this just a bug?

Thanks!

Brent


This message sent using iMail from I-Land Internet Services.
http://www.iland.net 


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RequiredIf Validator Doesn't Seem To Work With Nested Properties

2004-06-02 Thread Pacheco, Brent
Howdy!

I'm just wondering if anyone has run across this issue and if so, is there a
workaround?  It appears that the requiredif validator does not work
correctly when using nested properties.  Here's my XML:

field property=proofNumber
depends=requiredif,mask page=1
msg name=mask key=placard.errors.physiciansNumber/

arg0   key=placard.label.physiciansNumber/
var
var-namefield[0]/var-name

var-valueownerDEO.uniqueIdType/var-value
/var
var
var-namefieldTest[0]/var-name
var-valueEQUAL/var-value
/var
var
var-namefieldValue[0]/var-name
var-valueB/var-value
/var
var
var-namefield[1]/var-name
var-valueproofType/var-value
/var
var
var-namefieldTest[1]/var-name
var-valueEQUAL/var-value
/var
var
var-namefieldValue[1]/var-name
var-valueP/var-value
/var
var
var-namefieldJoin/var-name
var-valueAND/var-value
/var  
var
var-namemask/var-name
var-value^\d{5}|\d{6}|\d{10}$/var-value
/var
/field

When I had it coded such that the owner.uniqueId was not a nested property
(i.e. merely uniqueId), this validation worked perfectly.  Now, however,
no matter what is entered, the system throws an error.  Is there a different
syntax that I need to use or is this just a bug?

Thanks!

Brent

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]