Re: Conditional Validation

2007-11-03 Thread Gary Affonso
[EMAIL PROTECTED] wrote: Can anyone tell me how to do conditional validation in struts 2? In one form I want validations for a particular category (say Category XYZ) only if the candidate in that. If he is NOT Category XYZ then by checking a checkbox he should be able to skip the validations f

Re: Conditional validation

2007-09-18 Thread Ted Husted
I added this as * http://jira.opensymphony.com/browse/XW-565 -Ted. On 8/3/07, mraible <[EMAIL PROTECTED]> wrote: > > I figured out how to do this - posting here so others will benefit. - To unsubscribe, e-mail: [EMAIL PROTECTE

Re: Conditional validation

2007-08-20 Thread Zoran Avtarovski
I'm pretty sure you need to have around your expression. Z. > > Perhaps someone can order this XML to produce the desired result? > > > > > > > > > > > > > > > > model.password.equals(model.confirmPassword) > > > ${getText("nomatch")} ${model.password} and > ${model.confirmPas

Re: Conditional validation

2007-08-20 Thread Dave Newton
--- stanlick <[EMAIL PROTECTED]> wrote: > > model.password.equals(model.confirmPassword) > > ${getText("nomatch")} ${model.password} and > ${model.confirmPassword} > > I wouldn't even think that would pass DTD validation; doesn't the expression need to be in a param tag? d. --

Re: Conditional validation

2007-08-20 Thread stanlick
Perhaps someone can order this XML to produce the desired result? model.password.equals(mod

Re: Conditional validation

2007-08-19 Thread j alex
Can you paste the entry from validator xml -- and the line which is flagged with the error? >From the error message, it just looks like an ordering problem -- ie we must have param tag before the message tag ; but i may be oversimplifying things.. On 8/18/07, stanlick <[EMAIL PROTECTED]> wrote

Re: Conditional validation

2007-08-18 Thread stanlick
Matt -- Did you have trouble getting your validation entries to pass the dtd rules? I'm using "http://www.opensymphony.com/xwork/xwork-validator-1.0.2.dtd"; and getting the error The content of element type "field-validator" must match "(param*,message)". mraible wrote: > > I figured out ho

Re: Conditional validation

2007-08-13 Thread j alex
I'm still wondering how to do a pure flag check alone using validators - i.ei need to check a guard expression before firing actual validations on the field ; and if the guard expression fails - the validations must simply be skipped (as if the field didn't exist) and move on to next page - without

Re: Conditional validation

2007-08-13 Thread mraible
I haven't tried working with Struts 2's annotations for validation yet, so I'm unable to answer this question. In a week, things might be different. ;-) Matt strutstwouser wrote: > > Hi Matt, > > Can you please tell me what's needed to use this validator using > annotations alone? . Also, i

Re: Conditional validation

2007-08-13 Thread strutstwouser
Hi Matt, Can you please tell me what's needed to use this validator using annotations alone? . Also, i need a simple conditional validator - ie a field needs to be validated only if a prerequisite condition is satisfied, else the validations on it must be skipped and no error must be added (sinc

Re: Conditional validation

2007-08-03 Thread mraible
I figured out how to do this - posting here so others will benefit. 1. Create a new ConditionalVisitorFieldValidator.java: public class ConditionalVisitorFieldValidator extends VisitorFieldValidator { private String expression; public void setExpression(String expression) { this.expre

Re: Conditional validation

2007-08-01 Thread mraible
I need to do something similar - is it possible to have conditional visitor validation in Struts 2? AFAICT, it isn't. Basically, I'd like to have a couple of validation rules for a drop-down. One rule is that the user must select at least one choice when the drop-down has its radio button selecte

Re: Conditional validation in Struts.

2007-04-03 Thread Dave Newton
--- "Peter L. Berghold" <[EMAIL PROTECTED]> wrote: > Consider the following sniglet from my > validation.xml: > > depends="requiredif"> > > > field[0] > dropins_allowed_rq > > > fieldTest[0] > EQUALS > > > fieldValue[0] > on > > What version of Struts are you using? IIRC requiredif was d

RE: Conditional Validation

2006-07-31 Thread Givler, Eric
Can you override the validate() method in your form that extends ValidatorForm, and then inside that do something like this? public ActionErrors validate(ActionMapping mapping, HttpServletRequest request) { ActionErrors errors = null; if ( request.getParameter("closeButton") == null ) {

Re: Conditional Validation

2006-07-29 Thread Paul Benedict
If you do not use client-side validation (I never do), you can do this: Override getValidationKey() in your ActionForm and come up with a different key that the validator should use. You might want to look for a certain request parameter (like the close button) and either totally ignore validati

Re: Conditional validation

2006-05-04 Thread Adam Hardy
Dave Newton on 04/05/06 19:13, wrote: Adam Hardy wrote: In the last couple of days someone said that they separated the two flows using GET and POST - or at least I thought so. It sounded interesting but on looking at the struts-config DTD, there seems no way to do this. I can't find the threa

Re: Conditional validation

2006-05-04 Thread Dave Newton
Adam Hardy wrote: > In the last couple of days someone said that they separated the two > flows using GET and POST - or at least I thought so. > > It sounded interesting but on looking at the struts-config DTD, there > seems no way to do this. > > I can't find the thread in the archive now. Did I m

Re: Conditional validation

2006-05-04 Thread Michael Jouravlev
On May 4, 2006, at 11:27 AM, Adam Hardy wrote: > In the last couple of days someone said that they separated the two > flows using GET and POST - or at least I thought so. > > It sounded interesting but on looking at the struts-config DTD, > there seems no way to do this. > > I can't find the thr

Re: Conditional validation

2006-05-04 Thread Jakub Milkiewicz
Hi Can you point it where i can find it Thanks 2006/5/4, James Mitchell <[EMAIL PROTECTED]>: The newest version of the Struts mailreader sample app shows a best practices approach to just what you describe. Take a look at that and see if you might be able to do the same. (Specifically, look at

Re: Conditional validation

2006-05-04 Thread Adam Hardy
Could be easily overlooked, I agree - but is it even possible? I don't think it is possible to configure on the action mapping level. James Mitchell on 04/05/06 17:43, wrote: I don't think that would be the best solution (but that's just my 2c) -- I would opt for the declarative approach, with

Re: Conditional validation

2006-05-04 Thread James Mitchell
I don't think that would be the best solution (but that's just my 2c) -- I would opt for the declarative approach, with wildcards for "verbosely declarative simplicity" -- now there's an oxymoron for ya :) -- James Mitchell On May 4, 2006, at 11:27 AM, Adam Hardy wrote: In the last coupl

Re: Conditional validation

2006-05-04 Thread Adam Hardy
In the last couple of days someone said that they separated the two flows using GET and POST - or at least I thought so. It sounded interesting but on looking at the struts-config DTD, there seems no way to do this. I can't find the thread in the archive now. Did I misread that previous post

Re: Conditional validation

2006-05-04 Thread James Mitchell
The newest version of the Struts mailreader sample app shows a best practices approach to just what you describe. Take a look at that and see if you might be able to do the same. (Specifically, look at the paths for Edit* and Save*) HTH -- James Mitchell On May 4, 2006, at 9:40 AM, Mu

Re: conditional validation

2005-11-27 Thread Martin Gainty
Sent: Sunday, November 27, 2005 1:32 PM Subject: Re: conditional validation Thanks Martin for responding. But I am afraid we probably are talking of two different things. Unless I am missing some point somewhere. I am referring to regular expressions in the context of validator framework. (entrie

Re: conditional validation

2005-11-27 Thread Raghu Kanchustambham
> Taglib? > > http://struts.apache.org/struts-doc-1.2.7/userGuide/struts-logic.html#lessEqual > HTH, > M- > - Original Message - > From: "Raghu Kanchustambham" <[EMAIL PROTECTED]> > To: "Struts Users Mailing List" > Sent: Sunday, November 27, 2005 3:

Re: conditional validation

2005-11-27 Thread Martin Gainty
s Mailing List" Sent: Sunday, November 27, 2005 3:43 AM Subject: Re: conditional validation > ...(educationDetails[0].marks le 100)... Doesnt work... le/ge/gt/lt is not recognized. I worked around the problem by enforcing through floatRange to be between 35 and 100. Note that floatRange valid

Re: conditional validation

2005-11-27 Thread Raghu Kanchustambham
> ...(educationDetails[0].marks le 100)... Doesnt work... le/ge/gt/lt is not recognized. I worked around the problem by enforcing through floatRange to be between 35 and 100. Note that floatRange validations work perfectly fine. I wanted to allow either a "0" (to stand for a 'dont care') and a ra

Re: conditional validation

2005-11-25 Thread Laurie Harper
Raghu Kanchustambham wrote: Second, shouldn't you allow an empty value for marks if degree.id isn't set, rather than forcing the user to enter numeric data that's going to be ignored? I really dont care about what the user enters for marks if he chooses "none" for the degree. I dont care even

Re: conditional validation

2005-11-25 Thread Laurie Harper
newton rutgers wrote: Hello All, Can i do the conditional validation. For example if i have a drop down and the default value is "Please select one". if user dosen't select anything. validation won't show that it is required field to select. can anyone please help. Also how do i validation for

Re: conditional validation

2005-11-24 Thread Raghu Kanchustambham
Hi Laurie, Thanks for responding. > Firstly, the check for marks <= 100 in the validwhen rule is redundant, True! I realize that and have removed that. > Second, shouldn't you allow an empty value for marks if degree.id isn't set, > rather than forcing the user to enter numeric data that's going

Re: conditional validation

2005-11-24 Thread Laurie Harper
Raghu Kanchustambham wrote: Hi, I have the following situation: 1. educationDetails[0].degree.id is not chosen. (drop down return value = -1). OR 2. educationDetails[0].degree.id > 0 (the user chose one of the options from the drop down) which implies the marks should be atleast 35% and not mo

Re: Conditional validation

2005-11-08 Thread Laurie Harper
Jay Burgess wrote: I have a form field on my JSP that's being conditionally displayed based on the status of servlet context attribute: I'm using the Struts validator to validate this field: ... Obviously, I only want the client-side Javascript validations to fire if the field is pre

Re: Conditional validation for mask, date, integer etc

2005-10-25 Thread Saul Qunming Yuan
Saul Qunming Yuan dataanvil.com> writes: > > That's simlar to what I need, except that it's not an indexd property. Can > some of your code or send it to me offline. > > thanks, > Saul > > > On my current project I've written a validation method that > > dynamically invokes other validation ru

Re: Conditional validation for mask, date, integer etc

2005-10-19 Thread Saul Qunming Yuan
That's simlar to what I need, except that it's not an indexd property. Can some of your code or send it to me offline. thanks, Saul > On my current project I've written a validation method that > dynamically invokes other validation rules depending on the String > returned by bean.getDepends() >

Re: Conditional validation for mask, date, integer etc

2005-10-19 Thread Stewart Cambridge
On my current project I've written a validation method that dynamically invokes other validation rules depending on the String returned by bean.getDepends() It's used with indexed properties where the fields for the form to fill in are configurable and come from a database. Is that what you're af

Re: Conditional validation/field chaining with Validator plugin

2004-07-08 Thread Erik Weber
Upon further reading (sorry for the lack of rtfm), I discovered requiredif. Erik Erik Weber wrote: Greetings. I am using the Validator plugin with Struts ValidatorForm subclasses. In one form, I have a boolean select (the labels are "Yes" and "No", the values are "true" and "false"). There is a