RE: requiredif validation challenge

2003-12-12 Thread Clark Kent
Hi Udaya,
 
Thanks for the corrections.  
 
I have just found out that I am missing the public static boolean validateRequiredIf( 
) 
in the struts-validator.java class which should contain the java functionality to take 
care of requiredif validator.  So it seems like this patch needs to be added onto the 
class file.
 
Clark

Udaya Allu <[EMAIL PROTECTED]> wrote:
Hi Clark,

The following is similar validation in struts 1.1 final release working fine, for the 
case first field is necessary when second field is null, otherwise one of the two 
shall be available. Do not bother about additional condition of page attribute of page.
It is just show how to use two fields in required if.
The error your code is in in var-name 
change from field-test[0] to fieldTest[0] in final release of struts 1.1
can find this in struts validation doc.
Hope this will help
-Udaya 






field[0]
currentPage


fieldTest[0]
EQUAL


fieldValue[0]
1


field[1]
domain


fieldTest[1]
NULL


fieldJoin
AND






mask
^[a-zA-Z0-9]+([-.]*[a-zA-Z0-9])*$





-Original Message-
From: Clark Kent [mailto:[EMAIL PROTECTED]
Sent: Friday, December 12, 2003 12:01 PM
To: Struts Users Mailing List
Subject: requiredif validation challenge



I use Struts 1.1 and tried to add the patch for the requiredif validator in 
validator-rules.xml. 

Following is the code that I added in the validation.xml for the form. The form has 2 
fields and only one of them can be filled inorder to perform a search.





field[0]
userID



field-test[0]
NULL









field[0]
acctID



field-test[0]
NULL




It seems like inspite of the above, it still doesnt seem to validate requiredif 
validator and proceeds with the submit anyway. Can someone guide me?

Clark


-
Do you Yahoo!?
New Yahoo! Photos - easier uploading and sharing

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


-
Do you Yahoo!?
New Yahoo! Photos - easier uploading and sharing

RE: requiredif validation challenge

2003-12-12 Thread Udaya Allu
Hi Clark,

The following is similar validation in struts 1.1 final release working fine, for the 
case first  field is necessary when second field is null, otherwise one of the two 
shall be available. Do not bother about additional condition of page attribute of page.
It is just show how to use two fields in required if.
The error your code is in in  var-name 
change from field-test[0] to fieldTest[0] in final release of struts 1.1
can find this in struts validation doc.
Hope this will help
-Udaya 

   



  
field[0]
currentPage
  
  
fieldTest[0]
EQUAL

  
fieldValue[0]
1
  
  
field[1]
domain
  
  
fieldTest[1]
NULL
  
  
fieldJoin
AND






mask

^[a-zA-Z0-9]+([-.]*[a-zA-Z0-9])*$





-Original Message-
From: Clark Kent [mailto:[EMAIL PROTECTED]
Sent: Friday, December 12, 2003 12:01 PM
To: Struts Users Mailing List
Subject: requiredif validation challenge



I use Struts 1.1 and tried to add the patch for the requiredif validator in 
validator-rules.xml.  

Following is the code that I added in the validation.xml for the form.  The form has 2 
fields and only one of them can be filled inorder to perform a search.





field[0]
userID



field-test[0]
NULL









field[0]
acctID



field-test[0]
NULL
 



It seems like inspite of the above, it still doesnt seem to validate requiredif 
validator and proceeds with the submit anyway.  Can someone guide me?

Clark


-
Do you Yahoo!?
New Yahoo! Photos - easier uploading and sharing

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



RE: Requiredif error?

2003-10-31 Thread Ramadoss Chinnakuzhandai
Try
 fieldTest[0]
 
 
-Original Message-
From: Greg Hess [mailto:[EMAIL PROTECTED]
Sent: Saturday, October 25, 2003 12:21 PM
To: Struts
Subject: Requiredif error?


Hi All,
 
I get the following error when I submit my form using the requiredif:
 
25 Oct 2003 12:03:13,311 - ERROR org.apache.commons.validator.Validator - reflection: 
null
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at 
org.apache.commons.validator.Validator.validateFieldForRule(Validator.java:454)
at org.apache.commons.validator.Validator.validateField(Validator.java:544)
at org.apache.commons.validator.Validator.validate(Validator.java:582)
at 
org.apache.struts.validator.ValidatorForm.validate(ValidatorForm.java:152)
at 
org.apache.struts.action.RequestProcessor.processValidate(RequestProcessor.java:942)
at 
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:255)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:165)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:103)
at 
com.caucho.server.http.FilterChainServlet.doFilter(FilterChainServlet.java:96)
at 
com.caucho.http.security.SecurityFilter.doFilter(SecurityFilter.java:115)
at 
com.caucho.server.http.FilterChainFilter.doFilter(FilterChainFilter.java:88)
at com.caucho.server.http.Invocation.service(Invocation.java:315)
at com.caucho.server.http.CacheInvocation.service(CacheInvocation.java:135)
at com.caucho.server.http.HttpRequest.handleRequest(HttpRequest.java:246)
at 
com.caucho.server.http.HttpRequest.handleConnection(HttpRequest.java:164)
at com.caucho.server.TcpConnection.run(TcpConnection.java:139)
at java.lang.Thread.run(Thread.java:536)
Caused by: java.lang.NullPointerException
at 
org.apache.struts.validator.FieldChecks.validateRequiredIf(FieldChecks.java:200)
... 23 more
 
My config is good:
 


  

  field[0]
  event
  
  
  field-test[0]
  NOTNULL



 
If I switch the rule to required all is well. Any help is much appreciated.
 

Greg Hess

Software Engineer

Wrapped Apps Corporation

275 Michael Cowpland Dr.

Suite 201

Ottawa, Ontario

K2M 2G2

Tel: (613) 591 -7552

Fax: (613) 591-0523

1 (877) 388-6742

www.wrappedapps.com

  
 


RE: requiredif

2003-10-28 Thread Greg Dunn
Since no one offered an example for requiredIf:

In this case either x_Company OR x_First_Name and x_Last_Name are required,
so x_First_Name AND x_Last_Name are requiredIf x_Company is NULL, and
company is required if either first name OR last name is null.







field[0]
x_Company


field-test[0]
NULL








field[0]
x_Company


field-test[0]
NULL








field[0]
x_First_Name


field-test[0]
NULL


field[1]
x_Last_Name


field-test[1]
NULL


field-join
OR





Greg

-Original Message-
From: Rhet Behler [mailto:[EMAIL PROTECTED]
Sent: Monday, October 27, 2003 5:47 PM
To: Struts Users Mailing List
Subject: requiredif


Has anyone used this in the validation.xml?

If so could I see a simple example?

If not what are you using validwhen?

thanks


-
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

2003-10-28 Thread Koni Roth
http://cvs.apache.org/builds/jakarta-struts/nightly/

Ruben Orta Magan wrote:

- Original Message - 
From: "Marc Dugger" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>


"The new validwhen validation rule, which will be included into the Struts
release immediately after the 1.1 release..."


I am using the nightly build to develop my app and am hoping 1.2 will be
release by the time I'm ready to deploy.  So far, validwhen is operating
as

promised.  I haven't run into any problems, but you may search the
archives

to view other opinions.


How I can download the nightly build version?

Thanks

-
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

2003-10-28 Thread Ruben Orta Magan

- Original Message - 
From: "Marc Dugger" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>


> "The new validwhen validation rule, which will be included into the Struts
> release immediately after the 1.1 release..."

> I am using the nightly build to develop my app and am hoping 1.2 will be
> release by the time I'm ready to deploy.  So far, validwhen is operating
as
> promised.  I haven't run into any problems, but you may search the
archives
> to view other opinions.

How I can download the nightly build version?

Thanks


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



RE: requiredif

2003-10-27 Thread Marc Dugger
"The new validwhen validation rule, which will be included into the Struts
release immediately after the 1.1 release..."

I am using the nightly build to develop my app and am hoping 1.2 will be
release by the time I'm ready to deploy.  So far, validwhen is operating as
promised.  I haven't run into any problems, but you may search the archives
to view other opinions.


> -Original Message-
> From: Rhet Behler [mailto:[EMAIL PROTECTED]
> Sent: Monday, October 27, 2003 7:17 PM
> To: Struts Users Mailing List
> Subject: Re: requiredif
>
>
> validwhen isn't available in struts 1.1 is it?
>
> have you used this or tested it?
>
>
> - Original Message -
> From: "Marc Dugger" <[EMAIL PROTECTED]>
> To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
> Sent: Monday, October 27, 2003 5:32 PM
> Subject: RE: requiredif
>
>
> > My understanding is that 'requiredif' will be deprecated and the use of
> > 'validwhen' is encouraged.
> >
> > Example:
> >
> > 
> >   
> > 
> >   test
> >   ((sendNewsletter == null) or (*this* !=
> > null))
> > 
> >   
> >
> >
> > > -Original Message-
> > > From: Rhet Behler [mailto:[EMAIL PROTECTED]
> > > Sent: Monday, October 27, 2003 5:47 PM
> > > To: Struts Users Mailing List
> > > Subject: requiredif
> > >
> > >
> > > Has anyone used this in the validation.xml?
> > >
> > > If so could I see a simple example?
> > >
> > > If not what are you using validwhen?
> > >
> > > thanks
> >
> >
> > -
> > 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

2003-10-27 Thread Rhet Behler
validwhen isn't available in struts 1.1 is it?

have you used this or tested it?


- Original Message - 
From: "Marc Dugger" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Monday, October 27, 2003 5:32 PM
Subject: RE: requiredif


> My understanding is that 'requiredif' will be deprecated and the use of
> 'validwhen' is encouraged.
> 
> Example:
> 
> 
>   
> 
>   test
>   ((sendNewsletter == null) or (*this* !=
> null))
> 
>   
> 
> 
> > -Original Message-
> > From: Rhet Behler [mailto:[EMAIL PROTECTED]
> > Sent: Monday, October 27, 2003 5:47 PM
> > To: Struts Users Mailing List
> > Subject: requiredif
> >
> >
> > Has anyone used this in the validation.xml?
> >
> > If so could I see a simple example?
> >
> > If not what are you using validwhen?
> >
> > thanks
> 
> 
> -
> 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

2003-10-27 Thread Marc Dugger
My understanding is that 'requiredif' will be deprecated and the use of
'validwhen' is encouraged.

Example:


  

  test
  ((sendNewsletter == null) or (*this* !=
null))

  


> -Original Message-
> From: Rhet Behler [mailto:[EMAIL PROTECTED]
> Sent: Monday, October 27, 2003 5:47 PM
> To: Struts Users Mailing List
> Subject: requiredif
>
>
> Has anyone used this in the validation.xml?
>
> If so could I see a simple example?
>
> If not what are you using validwhen?
>
> thanks


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



Re: requiredif validator

2003-10-15 Thread Adam Hardy
On 10/15/2003 01:47 PM Erez Efrati wrote:
Oops, sorry, what I wanted to know is about 'requiredWhen'.

Erez

-Original Message-
From: Erez Efrati [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, October 15, 2003 11:12 AM
To: 'Struts Users Mailing List'
Subject: requiredif validator

Hi,

I am using the validator 1.02 that came with Struts 1.1. 
How do I get the 'requiredif' validator to work? Or is it not included?

Thanks,

requiredWhen requiredWhen?

It's not in validation-rules.xml so I'd say it's an add-on like 
validateTwoFields.

Adam

--
struts 1.1 + tomcat 5.0.12 + java 1.4.2
Linux 2.4.20 RH9
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


RE: requiredif validator

2003-10-15 Thread Erez Efrati
Oops, sorry, what I wanted to know is about 'requiredWhen'.

Erez

-Original Message-
From: Erez Efrati [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, October 15, 2003 11:12 AM
To: 'Struts Users Mailing List'
Subject: requiredif validator

Hi,

I am using the validator 1.02 that came with Struts 1.1. 
How do I get the 'requiredif' validator to work? Or is it not included?

Thanks,


Erez



-
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 and *this*

2003-06-29 Thread James Turner
Requiredif doesn't provide the *this* constant, alas.

Validwhen will, and should be available in 1.1.1/1.2 (whatever we call
the next release), except that I may do another rewrite before release
it, since there's been a lot of suggestions to me to base it on the
Commons EL parser rather than doing a brand new one.

James

> -Original Message-
> From: Chen, Gin [mailto:[EMAIL PROTECTED] 
> Sent: Friday, June 27, 2003 11:15 AM
> To: 'Struts Users Mailing List'
> Subject: requiredif and *this*
> 
> 
> The new validwhen will provide a *this*
> So that you can easily test if 2 fields are equal.
> Is this available using requiredif?
> 
> I saw Raible's article regarding this but it requires 
> creating a custom validator. I'm not opposed to doing this 
> but I don't want to introduce new items for maintenance if it 
> is now available directly from Struts.
> 
> Thanks,
> -Tim
> 



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



RE: requiredif - simple example

2003-06-26 Thread Brian McSweeney

Hi Kevin,
Thanks for the reply.

I'm a little confused by your example though.
First off - what does the ${4dig} mean?
This won't validate a checkbox, right?

Second, you have a lot of stuff commented out. 
Are these fields getting validated?

Finally, if I wanted to just test against a boolean 
being checked would I do something like the following?





   mask
   ${4dig}
   

   field-checked[0]
true


I'm quite confused! Sorry,
Thanks,
Brian




-Original Message-
From: Kevin Robair [mailto:[EMAIL PROTECTED] 
Sent: 26 June 2003 14:30
To: Struts Users Mailing List
Subject: Re: requiredif - simple example

The following worked for me. Note that in RC1, the  tag values
are expected to be field-test[n], not fieldTest[n] and so on

The requiredif check was removed because in 1.1RC1, requiredif would
break
a javascript validator such as mask. I used custom validation instead.





   mask
   ${4dig}
   



You can also check out the Validator doc on the struts documentation.
Just
expand the struts-documentation webapp that comes with your version of
struts, it is under User and Developer Guides.

-Kevin


--- Brian McSweeney <[EMAIL PROTECTED]> wrote:
> Hi all,
>  
> The validator package works well for me. 
> But I'm trying to use the requiredif and failing.
>  
> I know there has been previous discussion of this, 
> but I'm trying to a simple validation based on a checkbox 
> so perhaps someone could tell me where I'm going wrong.
>  
> For example,
>  
> I want to validate a creditcard, if a checkbox is checked.
>  
> I currently am trying to do this as follows:
>  
>  
>   
> depends="requiredif,creditCard">
>  
>   
>  name="creditCard"
> key="CreditCard"
>   resource="false"
>   />
>  name="requiredif"
> key="A Credit-Card is"
>   resource="false"
>   />
>   
> myForm.checked
> on
>   
>   
>   
>  
>  
> The form name is: myForm
>  
> The creditcard field is named "creditCard"
> The checkbox field is named "checked"
>  
> Note that all other types of validation are working correctly for me.
>  
> Any help would be SO much appreciated.
> Brian
> 


-
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 - simple example

2003-06-26 Thread Kevin Robair
The following worked for me. Note that in RC1, the  tag values
are expected to be field-test[n], not fieldTest[n] and so on

The requiredif check was removed because in 1.1RC1, requiredif would break
a javascript validator such as mask. I used custom validation instead.





   mask
   ${4dig}
   



You can also check out the Validator doc on the struts documentation. Just
expand the struts-documentation webapp that comes with your version of
struts, it is under User and Developer Guides.

-Kevin


--- Brian McSweeney <[EMAIL PROTECTED]> wrote:
> Hi all,
>  
> The validator package works well for me. 
> But I'm trying to use the requiredif and failing.
>  
> I know there has been previous discussion of this, 
> but I'm trying to a simple validation based on a checkbox 
> so perhaps someone could tell me where I'm going wrong.
>  
> For example,
>  
> I want to validate a creditcard, if a checkbox is checked.
>  
> I currently am trying to do this as follows:
>  
>  
>   
> depends="requiredif,creditCard">
>  
>   
>  name="creditCard"
> key="CreditCard"
>   resource="false"
>   />
>  name="requiredif"
> key="A Credit-Card is"
>   resource="false"
>   />
>   
> myForm.checked
> on
>   
>   
>   
>  
>  
> The form name is: myForm
>  
> The creditcard field is named "creditCard"
> The checkbox field is named "checked"
>  
> Note that all other types of validation are working correctly for me.
>  
> Any help would be SO much appreciated.
> Brian
> 


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



RE: requiredif question

2003-06-25 Thread Mick Knutson
I extend org.apache.struts.validator.ValidatorActionForm and all my normal 
validation works except the requiredif.



---
Thanks...
Mick Knutson
---




From: Sandeep Takhar <[EMAIL PROTECTED]>
Reply-To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
To: Struts Users Mailing List <[EMAIL PROTECTED]>
Subject: RE: requiredif question
Date: Wed, 25 Jun 2003 15:21:50 -0700 (PDT)
Are you extending ValidatorForm?

sandeep
--- "Kamholz, Keith   (corp-staff) USX"
<[EMAIL PROTECTED]> wrote:
> Here's my struts-config and my validation.xml.  I've
> also attached them, if
> it's easier to look at that way.  I've only shown
> parts of my
> struts-config.xml, enough to show one example action
> that isn't validating
> right.
> ___
>
> Struts-Config snippets:
>
> 
> type="com.moog.us.app.ans.data.AnsmItem"/>
> type="com.moog.us.app.ans.data.AnsaItem"/>
> 
>
>  type="com.moog.us.app.ans.action.AddANSM"
>validate="true"
>name="ansm"
>scope="request"
>input="tiles.addFormat"/>
>
> 
processorClass="com.moog.us.struts.AppRequestProcessor"
> />
>
>  parameter="ApplicationResources"/>
>
>  className="com.moog.us.struts.AppStartupPlugin"/>
>  className="org.apache.struts.tiles.TilesPlugin" >
>  value="/WEB-INF/tiles-defs.xml" />
>  value="true" />
> property="definitions-parser-validate" value="true"
> />
> 
> 
className="org.apache.struts.validator.ValidatorPlugIn">
> property="pathnames"
>
>
value="/WEB-INF/validator-rules.xml,/WEB-INF/validation.xml"/>
> 
>
> ___
>
> Validation.xml:
>
> 
>
>"-//Apache Software Foundation//DTD
> Commons Validator Rules
> Configuration 1.0//EN"
>
>
"http://jakarta.apache.org/commons/dtds/validator_1_0.dtd";>
>
> 
>
> 
> 
>
>
>
>        depends="required">
>
>
>depends="required">
>
>
>
>
>
> 
>
>
>
>
> If I should send any other files, let me know.
> Any input would be great, thanks!
>
>
> - Keith
>
>
>
>
>
>
>
> -Original Message-
> From: Mick Knutson [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, June 25, 2003 1:32 PM
> To: [EMAIL PROTECTED]
> Subject: RE: requiredif question
>
>
> I did not see yours. Can you post your code again?
>
>
>
> ---
> Thanks...
> Mick Knutson
> ---
>
>
>
>
>
> >From: "Kamholz, Keith   (corp-staff) USX"
> <[EMAIL PROTECTED]>
> >Reply-To: "Struts Users Mailing List"
> <[EMAIL PROTECTED]>
> >To: 'Struts Users Mailing List'
> <[EMAIL PROTECTED]>
> >Subject: RE: requiredif question
> >Date: Wed, 25 Jun 2003 13:26:48 -0400
> >
> >I'm having a similar problem.  All I'm trying to do
> is have a 'required'
> >condition for 2 fields of my form.  Mine submits
> just fine when I leave it
> >blank as well.  I posted my code here yesterday,
> but nobody was able to
> >help
> >me.  If you figure this out, I'd appreciate it if
> you let me know what the
> >problem is.  I'll do the same!
> >
> >- Keith
> >
> >
> >-Original Message-
> >From: Mick Knutson [mailto:[EMAIL PROTECTED]
> >Sent: Wednesday, June 25, 2003 1:26 PM
> >To: [EMAIL PROTECTED]
> >Subject: Re: requiredif question
> >
> >
> >Yes, no matter what I enter, nothing happends at
> all. It just accepts
> >whatever I enter, or leave blank, and submits just
> fine.
> >
> >
> >
> >---
> >Thanks...
> >Mick Knutson
> >---
> >
> >
> >
> >
> >
> > >From: Kevin Robair <[EMAIL PROTECTED]>
> > >Reply-To: "Struts Users Mailing List"
> <[EMAIL PROTECTED]>
> > >To: Struts Users Mailing List
> <[EMAIL PROTECTED]>
> > >Subject: Re: requiredif question
> > >Date: Wed, 25 Jun 2003 10:20:35 -0700 (PDT)
> > >
> > >Just a hunch:
> > >
> > >For Struts 1.1RC1 , the varnames should be:
> > >
> > >field-t

RE: requiredif question

2003-06-25 Thread Sandeep Takhar
Are you extending ValidatorForm?

sandeep
--- "Kamholz, Keith   (corp-staff) USX"
<[EMAIL PROTECTED]> wrote:
> Here's my struts-config and my validation.xml.  I've
> also attached them, if
> it's easier to look at that way.  I've only shown
> parts of my
> struts-config.xml, enough to show one example action
> that isn't validating
> right.
> ___
> 
> Struts-Config snippets:
> 
> 
>type="com.moog.us.app.ans.data.AnsmItem"/>
>type="com.moog.us.app.ans.data.AnsaItem"/>
> 
> 
>  type="com.moog.us.app.ans.action.AddANSM"
>   validate="true"
>   name="ansm"
>   scope="request"
>   input="tiles.addFormat"/>
> 
> 
processorClass="com.moog.us.struts.AppRequestProcessor"
> />
> 
>  parameter="ApplicationResources"/>
> 
>  className="com.moog.us.struts.AppStartupPlugin"/>
>  className="org.apache.struts.tiles.TilesPlugin" >
> value="/WEB-INF/tiles-defs.xml" />
>  value="true" />
>property="definitions-parser-validate" value="true"
> />
> 
> 
className="org.apache.struts.validator.ValidatorPlugIn">
>property="pathnames"
>
>
value="/WEB-INF/validator-rules.xml,/WEB-INF/validation.xml"/>
> 
> 
> ___
> 
> Validation.xml:
> 
> 
> 
>"-//Apache Software Foundation//DTD
> Commons Validator Rules
> Configuration 1.0//EN"
>  
>
"http://jakarta.apache.org/commons/dtds/validator_1_0.dtd";>
> 
> 
> 
> 
> 
> 
>   
>   
>  depends="required">
>   
>   
>  depends="required">
>   
>   
>   
>   
> 
> 
> 
> 
> 
> 
> If I should send any other files, let me know.
> Any input would be great, thanks!
> 
> 
> - Keith
> 
> 
> 
> 
> 
> 
> 
> -Original Message-
> From: Mick Knutson [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, June 25, 2003 1:32 PM
> To: [EMAIL PROTECTED]
> Subject: RE: requiredif question
> 
> 
> I did not see yours. Can you post your code again?
> 
> 
> 
> ---
> Thanks...
> Mick Knutson
> ---
> 
> 
> 
> 
> 
> >From: "Kamholz, Keith   (corp-staff) USX"
> <[EMAIL PROTECTED]>
> >Reply-To: "Struts Users Mailing List"
> <[EMAIL PROTECTED]>
> >To: 'Struts Users Mailing List'
> <[EMAIL PROTECTED]>
> >Subject: RE: requiredif question
> >Date: Wed, 25 Jun 2003 13:26:48 -0400
> >
> >I'm having a similar problem.  All I'm trying to do
> is have a 'required'
> >condition for 2 fields of my form.  Mine submits
> just fine when I leave it
> >blank as well.  I posted my code here yesterday,
> but nobody was able to 
> >help
> >me.  If you figure this out, I'd appreciate it if
> you let me know what the
> >problem is.  I'll do the same!
> >
> >- Keith
> >
> >
> >-Original Message-
> >From: Mick Knutson [mailto:[EMAIL PROTECTED]
> >Sent: Wednesday, June 25, 2003 1:26 PM
> >To: [EMAIL PROTECTED]
> >Subject: Re: requiredif question
> >
> >
> >Yes, no matter what I enter, nothing happends at
> all. It just accepts
> >whatever I enter, or leave blank, and submits just
> fine.
> >
> >
> >
> >---
> >Thanks...
> >Mick Knutson
> >---
> >
> >
> >
> >
> >
> > >From: Kevin Robair <[EMAIL PROTECTED]>
> > >Reply-To: "Struts Users Mailing List"
> <[EMAIL PROTECTED]>
> > >To: Struts Users Mailing List
> <[EMAIL PROTECTED]>
> > >Subject: Re: requiredif question
> > >Date: Wed, 25 Jun 2003 10:20:35 -0700 (PDT)
> > >
> > >Just a hunch:
> > >
> > >For Struts 1.1RC1 , the varnames should be:
> > >
> > >field-test[x]
> > >field-join
> > >etc...
> > >
> > >In 1.1RC2, they are
> > >
> > >fieldTest[n]
> > >fieldJoin
> > >etc
> > >
> > >BTW, I am unsur

RE: requiredif question

2003-06-25 Thread Kamholz, Keith (corp-staff) USX
Here's my struts-config and my validation.xml.  I've also attached them, if
it's easier to look at that way.  I've only shown parts of my
struts-config.xml, enough to show one example action that isn't validating
right.
___

Struts-Config snippets:






















___

Validation.xml:



http://jakarta.apache.org/commons/dtds/validator_1_0.dtd";>






















If I should send any other files, let me know.
Any input would be great, thanks!


- Keith







-Original Message-
From: Mick Knutson [mailto:[EMAIL PROTECTED]
Sent: Wednesday, June 25, 2003 1:32 PM
To: [EMAIL PROTECTED]
Subject: RE: requiredif question


I did not see yours. Can you post your code again?



---
Thanks...
Mick Knutson
---





>From: "Kamholz, Keith   (corp-staff) USX" <[EMAIL PROTECTED]>
>Reply-To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
>To: 'Struts Users Mailing List' <[EMAIL PROTECTED]>
>Subject: RE: requiredif question
>Date: Wed, 25 Jun 2003 13:26:48 -0400
>
>I'm having a similar problem.  All I'm trying to do is have a 'required'
>condition for 2 fields of my form.  Mine submits just fine when I leave it
>blank as well.  I posted my code here yesterday, but nobody was able to 
>help
>me.  If you figure this out, I'd appreciate it if you let me know what the
>problem is.  I'll do the same!
>
>- Keith
>
>
>-Original Message-
>From: Mick Knutson [mailto:[EMAIL PROTECTED]
>Sent: Wednesday, June 25, 2003 1:26 PM
>To: [EMAIL PROTECTED]
>Subject: Re: requiredif question
>
>
>Yes, no matter what I enter, nothing happends at all. It just accepts
>whatever I enter, or leave blank, and submits just fine.
>
>
>
>---
>Thanks...
>Mick Knutson
>---
>
>
>
>
>
> >From: Kevin Robair <[EMAIL PROTECTED]>
> >Reply-To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
> >To: Struts Users Mailing List <[EMAIL PROTECTED]>
> >Subject: Re: requiredif question
> >Date: Wed, 25 Jun 2003 10:20:35 -0700 (PDT)
> >
> >Just a hunch:
> >
> >For Struts 1.1RC1 , the varnames should be:
> >
> >field-test[x]
> >field-join
> >etc...
> >
> >In 1.1RC2, they are
> >
> >fieldTest[n]
> >fieldJoin
> >etc
> >
> >BTW, I am unsure what you mean by:
> >
> >   "does not seem to operate at all"
> >
> >Are there any errors or exceptions in the log? If the form validates no
> >matter what you enter, and there are no errors in the log, then it is
> >possibly a configuration problem. You could try a simpler validation, in
> >place of this one just to make sure it is doing something. Then, remove
> >the NOTNULL check, and see if the NOTEQUAL alone works.
> >
> >-Kevin
> >
> >--- Mick Knutson <[EMAIL PROTECTED]> wrote:
> > > I have the following code that does not seem to operate at all.
> > >
> > > I want phone1type to be a required field _if_ the phone1 attribute is
> > > _not_
> > > ""
> > >
> > >  > > depends="requiredif">
> > > 
> > > 
> > > field[0]
> > > phone1
> > > 
> > > 
> > > fieldTest[0]
> > > NOTNULL
> > > 
> > > 
> > > field[1]
> > > phone1
> > >   
> > >   
> > > fieldTest[1]
> > > NOTEQUAL
> > >   
> > >   
> > > fieldValue[1]
> > >  
> > >   
> > >   
> > > fieldJoin
> > > OR
> > > 
> > > 
> > >
> > >
> > >
> > >
> > > ---
> > > Thanks...
> > > Mick Knutson
> > > ---
> > >
> > > _
> > > Tired of spam? Get advanced

RE: requiredif question

2003-06-25 Thread Mick Knutson
I did not see yours. Can you post your code again?



---
Thanks...
Mick Knutson
---




From: "Kamholz, Keith   (corp-staff) USX" <[EMAIL PROTECTED]>
Reply-To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
To: 'Struts Users Mailing List' <[EMAIL PROTECTED]>
Subject: RE: requiredif question
Date: Wed, 25 Jun 2003 13:26:48 -0400
I'm having a similar problem.  All I'm trying to do is have a 'required'
condition for 2 fields of my form.  Mine submits just fine when I leave it
blank as well.  I posted my code here yesterday, but nobody was able to 
help
me.  If you figure this out, I'd appreciate it if you let me know what the
problem is.  I'll do the same!

- Keith

-Original Message-
From: Mick Knutson [mailto:[EMAIL PROTECTED]
Sent: Wednesday, June 25, 2003 1:26 PM
To: [EMAIL PROTECTED]
Subject: Re: requiredif question
Yes, no matter what I enter, nothing happends at all. It just accepts
whatever I enter, or leave blank, and submits just fine.


---
Thanks...
Mick Knutson
---




>From: Kevin Robair <[EMAIL PROTECTED]>
>Reply-To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
>To: Struts Users Mailing List <[EMAIL PROTECTED]>
>Subject: Re: requiredif question
>Date: Wed, 25 Jun 2003 10:20:35 -0700 (PDT)
>
>Just a hunch:
>
>For Struts 1.1RC1 , the varnames should be:
>
>field-test[x]
>field-join
>etc...
>
>In 1.1RC2, they are
>
>fieldTest[n]
>fieldJoin
>etc
>
>BTW, I am unsure what you mean by:
>
>   "does not seem to operate at all"
>
>Are there any errors or exceptions in the log? If the form validates no
>matter what you enter, and there are no errors in the log, then it is
>possibly a configuration problem. You could try a simpler validation, in
>place of this one just to make sure it is doing something. Then, remove
>the NOTNULL check, and see if the NOTEQUAL alone works.
>
>-Kevin
>
>--- Mick Knutson <[EMAIL PROTECTED]> wrote:
> > I have the following code that does not seem to operate at all.
> >
> > I want phone1type to be a required field _if_ the phone1 attribute is
> > _not_
> > ""
> >
> >  > depends="requiredif">
> > 
> > 
> > field[0]
> > phone1
> > 
> > 
> > fieldTest[0]
> > NOTNULL
> > 
> > 
> > field[1]
> > phone1
> >   
> >   
> > fieldTest[1]
> > NOTEQUAL
> >   
> >   
> > fieldValue[1]
> >  
> >   
> >   
> > fieldJoin
> > OR
> > 
> > 
> >
> >
> >
> >
> > ---
> > Thanks...
> > Mick Knutson
> > ---
> >
> > _
> > Tired of spam? Get advanced junk mail protection with MSN 8.
> > http://join.msn.com/?page=features/junkmail
> >
> >
> > -
> > 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]
>
_
Tired of spam? Get advanced junk mail protection with MSN 8.
http://join.msn.com/?page=features/junkmail
-
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]
_
Add photos to your messages with MSN 8. Get 2 months FREE*.  
http://join.msn.com/?page=features/featuredemail

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


RE: requiredif question

2003-06-25 Thread Kamholz, Keith (corp-staff) USX
I'm having a similar problem.  All I'm trying to do is have a 'required'
condition for 2 fields of my form.  Mine submits just fine when I leave it
blank as well.  I posted my code here yesterday, but nobody was able to help
me.  If you figure this out, I'd appreciate it if you let me know what the
problem is.  I'll do the same!

- Keith


-Original Message-
From: Mick Knutson [mailto:[EMAIL PROTECTED]
Sent: Wednesday, June 25, 2003 1:26 PM
To: [EMAIL PROTECTED]
Subject: Re: requiredif question


Yes, no matter what I enter, nothing happends at all. It just accepts 
whatever I enter, or leave blank, and submits just fine.



---
Thanks...
Mick Knutson
---





>From: Kevin Robair <[EMAIL PROTECTED]>
>Reply-To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
>To: Struts Users Mailing List <[EMAIL PROTECTED]>
>Subject: Re: requiredif question
>Date: Wed, 25 Jun 2003 10:20:35 -0700 (PDT)
>
>Just a hunch:
>
>For Struts 1.1RC1 , the varnames should be:
>
>field-test[x]
>field-join
>etc...
>
>In 1.1RC2, they are
>
>fieldTest[n]
>fieldJoin
>etc
>
>BTW, I am unsure what you mean by:
>
>   "does not seem to operate at all"
>
>Are there any errors or exceptions in the log? If the form validates no
>matter what you enter, and there are no errors in the log, then it is
>possibly a configuration problem. You could try a simpler validation, in
>place of this one just to make sure it is doing something. Then, remove
>the NOTNULL check, and see if the NOTEQUAL alone works.
>
>-Kevin
>
>--- Mick Knutson <[EMAIL PROTECTED]> wrote:
> > I have the following code that does not seem to operate at all.
> >
> > I want phone1type to be a required field _if_ the phone1 attribute is
> > _not_
> > ""
> >
> >  > depends="requiredif">
> > 
> > 
> > field[0]
> > phone1
> > 
> > 
> > fieldTest[0]
> > NOTNULL
> > 
> > 
> > field[1]
> > phone1
> >   
> >   
> > fieldTest[1]
> > NOTEQUAL
> >   
> >   
> > fieldValue[1]
> >  
> >   
> >   
> > fieldJoin
> > OR
> > 
> > 
> >
> >
> >
> >
> > ---
> > Thanks...
> > Mick Knutson
> > ---
> >
> > _
> > Tired of spam? Get advanced junk mail protection with MSN 8.
> > http://join.msn.com/?page=features/junkmail
> >
> >
> > -
> > 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]
>

_
Tired of spam? Get advanced junk mail protection with MSN 8. 
http://join.msn.com/?page=features/junkmail


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

2003-06-25 Thread Mick Knutson
Yes, no matter what I enter, nothing happends at all. It just accepts 
whatever I enter, or leave blank, and submits just fine.



---
Thanks...
Mick Knutson
---




From: Kevin Robair <[EMAIL PROTECTED]>
Reply-To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
To: Struts Users Mailing List <[EMAIL PROTECTED]>
Subject: Re: requiredif question
Date: Wed, 25 Jun 2003 10:20:35 -0700 (PDT)
Just a hunch:

For Struts 1.1RC1 , the varnames should be:

field-test[x]
field-join
etc...
In 1.1RC2, they are

fieldTest[n]
fieldJoin
etc
BTW, I am unsure what you mean by:

  "does not seem to operate at all"

Are there any errors or exceptions in the log? If the form validates no
matter what you enter, and there are no errors in the log, then it is
possibly a configuration problem. You could try a simpler validation, in
place of this one just to make sure it is doing something. Then, remove
the NOTNULL check, and see if the NOTEQUAL alone works.
-Kevin

--- Mick Knutson <[EMAIL PROTECTED]> wrote:
> I have the following code that does not seem to operate at all.
>
> I want phone1type to be a required field _if_ the phone1 attribute is
> _not_
> ""
>
>  depends="requiredif">
> 
> 
> field[0]
> phone1
> 
> 
> fieldTest[0]
> NOTNULL
> 
> 
> field[1]
> phone1
>   
>   
> fieldTest[1]
> NOTEQUAL
>   
>   
> fieldValue[1]
>  
>   
>   
> fieldJoin
> OR
> 
> 
>
>
>
>
> ---
> Thanks...
> Mick Knutson
> ---
>
> _
> Tired of spam? Get advanced junk mail protection with MSN 8.
> http://join.msn.com/?page=features/junkmail
>
>
> -
> 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]
_
Tired of spam? Get advanced junk mail protection with MSN 8. 
http://join.msn.com/?page=features/junkmail

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


Re: requiredif question

2003-06-25 Thread Kevin Robair
Just a hunch:

For Struts 1.1RC1 , the varnames should be:

field-test[x]
field-join
etc...

In 1.1RC2, they are

fieldTest[n]
fieldJoin  
etc

BTW, I am unsure what you mean by:

  "does not seem to operate at all"

Are there any errors or exceptions in the log? If the form validates no
matter what you enter, and there are no errors in the log, then it is
possibly a configuration problem. You could try a simpler validation, in
place of this one just to make sure it is doing something. Then, remove
the NOTNULL check, and see if the NOTEQUAL alone works.

-Kevin

--- Mick Knutson <[EMAIL PROTECTED]> wrote:
> I have the following code that does not seem to operate at all.
> 
> I want phone1type to be a required field _if_ the phone1 attribute is
> _not_ 
> ""
> 
>  depends="requiredif">
> 
> 
> field[0]
> phone1
> 
> 
> fieldTest[0]
> NOTNULL
> 
> 
> field[1]
> phone1
>   
>   
> fieldTest[1]
> NOTEQUAL
>   
>   
> fieldValue[1]
>  
>   
>   
> fieldJoin
> OR
> 
> 
> 
> 
> 
> 
> ---
> Thanks...
> Mick Knutson
> ---
> 
> _
> Tired of spam? Get advanced junk mail protection with MSN 8. 
> http://join.msn.com/?page=features/junkmail
> 
> 
> -
> 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 question

2003-06-25 Thread David Graham
--- Mick Knutson <[EMAIL PROTECTED]> wrote:
> I have the following code that does not seem to operate at all.
> 
> I want phone1type to be a required field _if_ the phone1 attribute is
> _not_ 
> ""
> 
>  depends="requiredif">
> 
> 
> field[0]
> phone1
> 
> 
> fieldTest[0]
> NOTNULL
> 
> 
> field[1]
> phone1
>   
>   
> fieldTest[1]
> NOTEQUAL
>   
>   
> fieldValue[1]
>  

You can't define empty values in XML like that because the parser removes
the whitespace.  I'm not quite how to accomplish this though.

David


>   
>   
> fieldJoin
> OR
> 
> 
> 
> 
> 
> 
> ---
> Thanks...
> Mick Knutson
> ---
> 
> _
> Tired of spam? Get advanced junk mail protection with MSN 8. 
> http://join.msn.com/?page=features/junkmail
> 
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 


__
Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!
http://sbc.yahoo.com

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



RE: RequiredIf Example Request

2003-01-24 Thread Weber, Jeremy
Sorry I am not following you. I am trying to to use the 'requiredif'
validation not 'required' validation.  I dont have xml defining the field.
Just what I had posted in the previous message to illustrate my problem.  I
am currently looking at the code of requiredif to see if its functioning
properly.

You say to use required, mycheck.  But I cant require the field.  I need to
require it conditionally based on another field in the form.  That is why I
want to use requiredif.  Based on whether a field is true or false, validate
some other fields, kind of thing...

As for as the code for RequiredIf, it doesnt seem to me to handle EQUALS
well.  

boolean required = false;

...
...
...
if (dependTest.equals(FIELD_TEST_EQUAL)) {
this_required =
dependTestValue.equalsIgnoreCase(dependVal);
}
...
...

if (required) {
if ((value != null) && (value.length() > 0)) {
return true;
} else {
errors.add(field.getKey(), Resources.getActionError(request,
va, field));
return false;
}
}
}
No where does it seem to compare the xml value and the value on the actual
form.




If you have any other suggestions or can clarify, please do...  


Jeremy Weber
[EMAIL PROTECTED]


-Original Message-
From: Dennis Muhlestein [mailto:[EMAIL PROTECTED]]
Sent: Friday, January 24, 2003 3:39 PM
To: Struts Users Mailing List
Subject: RE: RequiredIf Example Request


I just barely ran into this problem.  Seems that all the field checks
are run.  Checking the Validator example (TowFieldCheck) in the struts
docs (1.1b3), It seems that if the value is null, you should let it pass
as accepted.

The xml defining the field is the one that should specify that the field
is required.  id: required,mycheck

Then it becomes possible to have an optional field.

-Dennis

On Thu, 2003-01-23 at 14:33, Weber, Jeremy wrote:
> Yes, but I would think that it would only be run after the first
validation
> (the requiredif) runs.  Is that not a correct assumption?  Do I need to
add
> anything to the exists validation to make it so?  In your example if the
> requiredif fails, does it still try to run the next validations?
> 
> 
> 
> Jeremy Weber
> [EMAIL PROTECTED]
> 
> 
> -Original Message-
> From: Greg Murray [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, January 23, 2003 4:20 PM
> To: Struts Users Mailing List
> Subject: RE: RequiredIf Example Request
> 
> 
> I'm not sure "exists" is a standard validation rule.  Did you define it
> yourself?
> 
> -Original Message-
> From: Weber, Jeremy [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, January 23, 2003 2:00 PM
> To: 'Struts Users Mailing List'
> Subject: RE: RequiredIf Example Request
> 
> 
> Thank you , thank you, thank you!
> 
> I misspoke when I said checkboxs, its a radio button, like this...
> 
>   
> 
>key="appserver.usesecure.displayname"/>
>onclick="showSecureOptions('true');"/> Yes
>onclick="showSecureOptions('false');"/> No
> 
> 
> 
> depends="requiredif,exists">
>   key="appserver.sslkeystore.displayname"/>
>  
>   field[0]
>   useSecure
>   
>   
>   field-test[0]
>   EQUAL
>   
>   
>   field-value[0]
>   true
>   
>   
> 
> 
> >From what I can tell, this looks like it will work... But it doesnt.
> However, this is the kicker... If I remove exists from depends, it acts as
> it should.  Now I figured that exists would only be called if requiredif
> passed.  Any thoughts?
> 
> 
> 
> 
> 
> 
> Jeremy Weber
> [EMAIL PROTECTED]
> 
> 
> -Original Message-
> From: Greg Murray [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, January 23, 2003 3:26 PM
> To: Struts Users Mailing List
> Subject: RE: RequiredIf Example Request
> 
> 
> If you're just requesting an example of something, here's what I'm
currently
> using:
> 
>depends="requiredif,integer,minlength,maxlength">
> 
> 
> 
> 
> 
>   minlength
>   9
> 

RE: RequiredIf Example Request

2003-01-24 Thread Dennis Muhlestein
I just barely ran into this problem.  Seems that all the field checks
are run.  Checking the Validator example (TowFieldCheck) in the struts
docs (1.1b3), It seems that if the value is null, you should let it pass
as accepted.

The xml defining the field is the one that should specify that the field
is required.  id: required,mycheck

Then it becomes possible to have an optional field.

-Dennis

On Thu, 2003-01-23 at 14:33, Weber, Jeremy wrote:
> Yes, but I would think that it would only be run after the first validation
> (the requiredif) runs.  Is that not a correct assumption?  Do I need to add
> anything to the exists validation to make it so?  In your example if the
> requiredif fails, does it still try to run the next validations?
> 
> 
> 
> Jeremy Weber
> [EMAIL PROTECTED]
> 
> 
> -Original Message-
> From: Greg Murray [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, January 23, 2003 4:20 PM
> To: Struts Users Mailing List
> Subject: RE: RequiredIf Example Request
> 
> 
> I'm not sure "exists" is a standard validation rule.  Did you define it
> yourself?
> 
> -Original Message-
> From: Weber, Jeremy [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, January 23, 2003 2:00 PM
> To: 'Struts Users Mailing List'
> Subject: RE: RequiredIf Example Request
> 
> 
> Thank you , thank you, thank you!
> 
> I misspoke when I said checkboxs, its a radio button, like this...
> 
>   
> 
>key="appserver.usesecure.displayname"/>
>onclick="showSecureOptions('true');"/> Yes
>onclick="showSecureOptions('false');"/> No
> 
> 
> 
> depends="requiredif,exists">
>   key="appserver.sslkeystore.displayname"/>
>  
>   field[0]
>   useSecure
>   
>   
>   field-test[0]
>   EQUAL
>   
>   
>   field-value[0]
>   true
>   
>   
> 
> 
> >From what I can tell, this looks like it will work... But it doesnt.
> However, this is the kicker... If I remove exists from depends, it acts as
> it should.  Now I figured that exists would only be called if requiredif
> passed.  Any thoughts?
> 
> 
> 
> 
> 
> 
> Jeremy Weber
> [EMAIL PROTECTED]
> 
> 
> -Original Message-
> From: Greg Murray [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, January 23, 2003 3:26 PM
> To: Struts Users Mailing List
> Subject: RE: RequiredIf Example Request
> 
> 
> If you're just requesting an example of something, here's what I'm currently
> using:
> 
>depends="requiredif,integer,minlength,maxlength">
> 
> 
> 
> 
> 
>   minlength
>   9
>  
> 
>   maxlength
>   9
> 
> 
>   field[0]
>   lastName
> 
> 
>   field-test[0]
>   NULL
> 
>   
> 
> This makes studentId required if lastName is NULL.  If I also wanted to add
> a requirement to make studentId required if firstName was null, I'd add the
> following to the above:
> 
> 
>   field[1]
>   lastName
> 
> 
>   field-test[1]
>   NULL
> 
> 
> The conditions you can have are NULL, NOTNULL, and EQUAL.
> 
> I haven't used this with checkboxes yet, but I think you'd probably have
> each of your three fields use requiredif, and use something like the
> following to make it depend on the checkbox:
> 
> 
>   field[0]
>   checkboxFieldName
> 
> 
>   field-test[0]
>   NOTNULL
> 
> 
> The fact that the example was using indicies screwed me up for a while too
> until I took a look at the source code for FieldChecks.
> 
> GM
> 
> -Original Message-
> From: Weber, Jeremy [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, January 23, 2003 12:57 PM
> To: 'Struts Users Mailing List' (E-mail)
> Subject: RequiredIf Example Request
> 
> 
> I requested this before and have not recieved a response...:(  Any takers
> out the

RE: RequiredIf Example Request

2003-01-23 Thread Weber, Jeremy
Yes, but I would think that it would only be run after the first validation
(the requiredif) runs.  Is that not a correct assumption?  Do I need to add
anything to the exists validation to make it so?  In your example if the
requiredif fails, does it still try to run the next validations?



Jeremy Weber
[EMAIL PROTECTED]


-Original Message-
From: Greg Murray [mailto:[EMAIL PROTECTED]]
Sent: Thursday, January 23, 2003 4:20 PM
To: Struts Users Mailing List
Subject: RE: RequiredIf Example Request


I'm not sure "exists" is a standard validation rule.  Did you define it
yourself?

-Original Message-
From: Weber, Jeremy [mailto:[EMAIL PROTECTED]]
Sent: Thursday, January 23, 2003 2:00 PM
To: 'Struts Users Mailing List'
Subject: RE: RequiredIf Example Request


Thank you , thank you, thank you!

I misspoke when I said checkboxs, its a radio button, like this...




 Yes
 No



 
   
   
field[0]
useSecure


field-test[0]
EQUAL


field-value[0]
true




>From what I can tell, this looks like it will work... But it doesnt.
However, this is the kicker... If I remove exists from depends, it acts as
it should.  Now I figured that exists would only be called if requiredif
passed.  Any thoughts?






Jeremy Weber
[EMAIL PROTECTED]


-Original Message-
From: Greg Murray [mailto:[EMAIL PROTECTED]]
Sent: Thursday, January 23, 2003 3:26 PM
To: Struts Users Mailing List
Subject: RE: RequiredIf Example Request


If you're just requesting an example of something, here's what I'm currently
using:

  





  minlength
  9
 

  maxlength
  9


  field[0]
  lastName


  field-test[0]
  NULL

  

This makes studentId required if lastName is NULL.  If I also wanted to add
a requirement to make studentId required if firstName was null, I'd add the
following to the above:


  field[1]
  lastName


  field-test[1]
  NULL


The conditions you can have are NULL, NOTNULL, and EQUAL.

I haven't used this with checkboxes yet, but I think you'd probably have
each of your three fields use requiredif, and use something like the
following to make it depend on the checkbox:


  field[0]
  checkboxFieldName


  field-test[0]
  NOTNULL


The fact that the example was using indicies screwed me up for a while too
until I took a look at the source code for FieldChecks.

GM

-Original Message-
From: Weber, Jeremy [mailto:[EMAIL PROTECTED]]
Sent: Thursday, January 23, 2003 12:57 PM
To: 'Struts Users Mailing List' (E-mail)
Subject: RequiredIf Example Request


I requested this before and have not recieved a response...:(  Any takers
out there?  Currently I am having a heck of time figuring out how to make
this work...  

I have checked out all the online examples, but I am unclear as to what this
stuff means...

If you have this in your struts-config.xml...






My form properties look like...




So I am missing the type and initial fields.  Can anybody help me see the
light?  I need a checkbox to control whether or not 3 addiotional text
fields are required.

Thanks,

Jeremy Weber
[EMAIL PROTECTED]

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


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

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


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

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




RE: RequiredIf Example Request

2003-01-23 Thread Greg Murray
I'm not sure "exists" is a standard validation rule.  Did you define it yourself?

-Original Message-
From: Weber, Jeremy [mailto:[EMAIL PROTECTED]]
Sent: Thursday, January 23, 2003 2:00 PM
To: 'Struts Users Mailing List'
Subject: RE: RequiredIf Example Request


Thank you , thank you, thank you!

I misspoke when I said checkboxs, its a radio button, like this...




 Yes
 No



 
   
   
field[0]
useSecure


field-test[0]
EQUAL


field-value[0]
true




>From what I can tell, this looks like it will work... But it doesnt.
However, this is the kicker... If I remove exists from depends, it acts as
it should.  Now I figured that exists would only be called if requiredif
passed.  Any thoughts?






Jeremy Weber
[EMAIL PROTECTED]


-Original Message-
From: Greg Murray [mailto:[EMAIL PROTECTED]]
Sent: Thursday, January 23, 2003 3:26 PM
To: Struts Users Mailing List
Subject: RE: RequiredIf Example Request


If you're just requesting an example of something, here's what I'm currently
using:

  





  minlength
  9
 

  maxlength
  9


  field[0]
  lastName


  field-test[0]
  NULL

  

This makes studentId required if lastName is NULL.  If I also wanted to add
a requirement to make studentId required if firstName was null, I'd add the
following to the above:


  field[1]
  lastName


  field-test[1]
  NULL


The conditions you can have are NULL, NOTNULL, and EQUAL.

I haven't used this with checkboxes yet, but I think you'd probably have
each of your three fields use requiredif, and use something like the
following to make it depend on the checkbox:


  field[0]
  checkboxFieldName


  field-test[0]
  NOTNULL


The fact that the example was using indicies screwed me up for a while too
until I took a look at the source code for FieldChecks.

GM

-Original Message-
From: Weber, Jeremy [mailto:[EMAIL PROTECTED]]
Sent: Thursday, January 23, 2003 12:57 PM
To: 'Struts Users Mailing List' (E-mail)
Subject: RequiredIf Example Request


I requested this before and have not recieved a response...:(  Any takers
out there?  Currently I am having a heck of time figuring out how to make
this work...  

I have checked out all the online examples, but I am unclear as to what this
stuff means...

If you have this in your struts-config.xml...






My form properties look like...




So I am missing the type and initial fields.  Can anybody help me see the
light?  I need a checkbox to control whether or not 3 addiotional text
fields are required.

Thanks,

Jeremy Weber
[EMAIL PROTECTED]

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


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

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


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




RE: RequiredIf Example Request

2003-01-23 Thread Weber, Jeremy
Thank you , thank you, thank you!

I misspoke when I said checkboxs, its a radio button, like this...




 Yes
 No



 
   
   
field[0]
useSecure


field-test[0]
EQUAL


field-value[0]
true




>From what I can tell, this looks like it will work... But it doesnt.
However, this is the kicker... If I remove exists from depends, it acts as
it should.  Now I figured that exists would only be called if requiredif
passed.  Any thoughts?






Jeremy Weber
[EMAIL PROTECTED]


-Original Message-
From: Greg Murray [mailto:[EMAIL PROTECTED]]
Sent: Thursday, January 23, 2003 3:26 PM
To: Struts Users Mailing List
Subject: RE: RequiredIf Example Request


If you're just requesting an example of something, here's what I'm currently
using:

  





  minlength
  9
 

  maxlength
  9


  field[0]
  lastName


  field-test[0]
  NULL

  

This makes studentId required if lastName is NULL.  If I also wanted to add
a requirement to make studentId required if firstName was null, I'd add the
following to the above:


  field[1]
  lastName


  field-test[1]
  NULL


The conditions you can have are NULL, NOTNULL, and EQUAL.

I haven't used this with checkboxes yet, but I think you'd probably have
each of your three fields use requiredif, and use something like the
following to make it depend on the checkbox:


  field[0]
  checkboxFieldName


  field-test[0]
  NOTNULL


The fact that the example was using indicies screwed me up for a while too
until I took a look at the source code for FieldChecks.

GM

-Original Message-
From: Weber, Jeremy [mailto:[EMAIL PROTECTED]]
Sent: Thursday, January 23, 2003 12:57 PM
To: 'Struts Users Mailing List' (E-mail)
Subject: RequiredIf Example Request


I requested this before and have not recieved a response...:(  Any takers
out there?  Currently I am having a heck of time figuring out how to make
this work...  

I have checked out all the online examples, but I am unclear as to what this
stuff means...

If you have this in your struts-config.xml...






My form properties look like...




So I am missing the type and initial fields.  Can anybody help me see the
light?  I need a checkbox to control whether or not 3 addiotional text
fields are required.

Thanks,

Jeremy Weber
[EMAIL PROTECTED]

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


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

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




RE: RequiredIf Example Request

2003-01-23 Thread Greg Murray
If you're just requesting an example of something, here's what I'm currently using:

  





  minlength
  9
 

  maxlength
  9


  field[0]
  lastName


  field-test[0]
  NULL

  

This makes studentId required if lastName is NULL.  If I also wanted to add a 
requirement to make studentId required if firstName was null, I'd add the following to 
the above:


  field[1]
  lastName


  field-test[1]
  NULL


The conditions you can have are NULL, NOTNULL, and EQUAL.

I haven't used this with checkboxes yet, but I think you'd probably have each of your 
three fields use requiredif, and use something like the following to make it depend on 
the checkbox:


  field[0]
  checkboxFieldName


  field-test[0]
  NOTNULL


The fact that the example was using indicies screwed me up for a while too until I 
took a look at the source code for FieldChecks.

GM

-Original Message-
From: Weber, Jeremy [mailto:[EMAIL PROTECTED]]
Sent: Thursday, January 23, 2003 12:57 PM
To: 'Struts Users Mailing List' (E-mail)
Subject: RequiredIf Example Request


I requested this before and have not recieved a response...:(  Any takers
out there?  Currently I am having a heck of time figuring out how to make
this work...  

I have checked out all the online examples, but I am unclear as to what this
stuff means...

If you have this in your struts-config.xml...






My form properties look like...




So I am missing the type and initial fields.  Can anybody help me see the
light?  I need a checkbox to control whether or not 3 addiotional text
fields are required.

Thanks,

Jeremy Weber
[EMAIL PROTECTED]

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 


--
To unsubscribe, e-mail:   
For additional commands, e-mail: