Hi,
> Thanks for the reply. Checkbox always has a value of true/false.
>
Well this is not case with all the frameworks... Truly speaking browser will
send only the field name and value to the server (along with some headers).
But S2 deals in this way such that checkbox will have false if it was
7;
Subject: RE: Struts 2 - Conditional Validation
Hi ManiKanta,
Thanks for the reply. Checkbox always has a value of true/false.
Below is the validation entry which is working for me -
Error Message.
Regards,
Richa
-Origin
...@gmail.com]
Sent: Thursday, December 11, 2008 10:28 PM
To: Struts Users Mailing List
Subject: Re: Struts 2 - Conditional Validation
>
>
(checkbox == true) and (textbox).equals("")
>
Unless u wrote ur custom validator dealig the 'checkbox == true' compari
>
>
(checkbox == true) and (textbox).equals("")
>
Unless u wrote ur custom validator dealig the 'checkbox == true' comparison,
by default these type of comparisons will not work.
You have to specify the check box's value (check box based whi
My form contains a checkbox and a text field. Entering a value in the text
field is mandatory only if the checkbox is selected. How to write the
conditional validation for this?
I tried the validation entry as below but it is not working–
(checkbox == true
annotation.html
>> >>
>> >> --- lbastil <[EMAIL PROTECTED]> wrote:
>> >>
>> >>>
>> >>> Hm, but as I have model driven action,
>> >>> for both methods (even if I want to validate
>> >>> different attr
ven if I want to validate
> >>> different attributes later on)
> >>> the first I have to use is VisitorFieldValidator
> >>> with appendPrefix=false for
> >>> the model attribute of the action class.
> >>>
> >>> So at this lev
ss.
>>>
>>> So at this level there is no difference, thats why I
>>> cannot see how it
>>> should help.
>>>
>>> Could you explain your suggestion a little more in
>>> detail?
>>> Would it be realizable with annotation
d.
>> > You can differentiate between them in a couple
>> > different ways, the easiest may be to just create
>> two
>> > action mappings, one for each method.
>> >
>> > d.
>> >
>> > --- lbastil <[EMAIL PROTECTED]> w
ch method.
> >
> > d.
> >
> > --- lbastil <[EMAIL PROTECTED]> wrote:
> >
> >>
> >> Is there any way with the build in declarative
> >> validation possibilities in
> >> struts 2 (annotations, xml)
> >> to do something like
>> struts 2 (annotations, xml)
>> to do something like conditional validation in the
>> following sense:
>>
>> in the action class I have a model class, where on
>> action method one i want
>> to validate
>> a special subset of model attributes and on actio
declarative
> validation possibilities in
> struts 2 (annotations, xml)
> to do something like conditional validation in the
> following sense:
>
> in the action class I have a model class, where on
> action method one i want
> to validate
> a special subset of model attrib
Is there any way with the build in declarative validation possibilities in
struts 2 (annotations, xml)
to do something like conditional validation in the following sense:
in the action class I have a model class, where on action method one i want
to validate
a special subset of model attributes
[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
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 for that. I am not able
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
;
>
> true
>
>
>
> ...
>
>
>
>
>
> cilquirm <[EMAIL PROTECTED]>
> 17/09/2007 16:50
> Veuillez répondre à
> "Struts Users Mailing List"
>
>
> A
> user@struts.apache.org
> cc
>
> Objet
> Re: [S2] C
17/09/2007 16:50
Veuillez répondre à
"Struts Users Mailing List"
A
user@struts.apache.org
cc
Objet
Re: [S2] Conditional Validation (test if field is present in JSP)
somewhat hackish, but you can accomplish this by using expressions :
#params['attrib'] != null ? att
g of this flag ?
>
> Thanks for your tips.
>
> Regards,
>
> Michaël
>
--
View this message in context:
http://www.nabble.com/-S2--Conditional-Validation-%28test-if-field-is-present-in-JSP%29-tf4465421.html#a12737286
Sent from the Struts - User mailing list archive at Nabble.com.
---
Hi all,
We have an Action redirecting to several JSP, depending on the customer.
But the forms of these JSP are different : some fields are added/removed
in some JSP.
So the automatic validation fails for those fields not existing in some
JSP.
We bypass the problem by copying the Action metho
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
--- 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.
--
(model.confirmPassword)
${getText("nomatch")} ${model.password} and
${model.confirmPassword}
--
View this message in context:
http://www.nabble.com/Conditional-validation-tf36
ields if the person
> >> selects the "Other..." option. The validation syntax starts to get
> >> complicated at this point. I'd like to do something like:
> >>
> >> reason != 'partner' or (reason == 'partner' and partnerPos
27;OTHER') -> kick in visitor validation.
>>
>> I still think the above syntax is confusing (ref
>> http://tinyurl.com/2htw2k), I'd much rather write something like:
>>
>> reason == 'partner' and partnerPositionID == 'OTHER' -> show
gt; drop-down. One rule is that the user must select at least one choice
> >>> when the drop-down has its radio button selected:
> >>>
> >>>
> >>> reason != 'partner' or (reason == 'partner' and
> >>> p
"Other..."
>>>
>>>
>>> This works. Now I want to require a number of fields if the person
>>> selects the "Other..." option. The validation syntax starts to get
>>> complicated at this point. I'd like to do something lik
he above syntax is confusing (ref
>> http://tinyurl.com/2htw2k), I'd much rather write something like:
>>
>> reason == 'partner' and partnerPositionID == 'OTHER' -> show message
>>
>> I'm guessing it's possible to write my own Fiel
te my own FieldExpressionValidator that
> inverses the true/false outcome?
>
> Why do I need conditional visitor validation?
>
> I'm trying to create a "component" that can be re-used in the backend
> (model object w/ its own validation rules) and on the front-end (
asier way to do this, please let me know. Of course, I could
use JSF/Wicket/Tapestry - and that might be the outcome if this is not
possible.
Thanks,
Matt
Sparecreative wrote:
>
> Is there a way to setup conditional validation through the validation.xml
> file?
>
> I'm cur
Is there a way to setup conditional validation through the validation.xml
file?
I'm currently user the visitor validator method where my core user
validation properties are in a User-validation.xml file. I want to be able
to use this same file for all my user actions (register, add, update
--- "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
Consider the following sniglet from my validation.xml:
field[0]
dropins_allowed_rq
fieldTest[0]
EQUALS
fieldValue[0]
on
What I'm trying to accomplish is if the checkbox dropins_allowed_rq is
checked then I want to consider the text field nonmember_dropin_rate_rq
as a required field, othe
To: user@struts.apache.org
Cc:
Subject: Conditional Validation
I am using the Struts validation.xml to check if
clients leave any of the required text fields in the
form blank.
I prepared two action mappings for this web
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
I am using the Struts validation.xml to check if
clients leave any of the required text fields in the
form blank.
I prepared two action mappings for this web page. The
'validate'attribute is set to "false" for the first
action mapping because when I have the web page
displayed in the browserat th
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
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
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
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
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
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
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
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
I just started playing with the commons-validator and came across a
problem with how I have my Struts application structured. I am using
dispatch actions that have "load" and "save" methods. In the "load" I
retrieve the reference data needed to build the page and then forward to
the jsp page. In th
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
> 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:
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
> ...(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
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
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
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
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
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 more
than 100%
I tried the atta
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
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 present.
Is there a w
s that what you're after?
> >
> > Stew
> >
> > On 19/10/05, Saul Qunming Yuan dataanvil.com> wrote:
> >> Hi All,
> >>
> >>
> >> I'm wondering if there is a way to define conditional validation for
> >> mask,
> >> d
urned 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 after?
>
> Stew
>
> On 19/10/05, Saul Qunming Yuan <[EMAIL PROTECTED]> wrote:
>&g
hat you're after?
Stew
On 19/10/05, Saul Qunming Yuan <[EMAIL PROTECTED]> wrote:
> Hi All,
>
>
> I'm wondering if there is a way to define conditional validation for mask,
> date, integer etc in validation.xml. I know there is a "validwhen", but it
>
Hi All,
I'm wondering if there is a way to define conditional validation for mask,
date, integer etc in validation.xml. I know there is a "validwhen", but it
only checks for the condition as defined by the "test" variable. What I
want is to perform the mask, date valida
e" and "false"). There is a companion text area for
an explanation -- to be filled in if the boolean select value happens
to be "true". So in otherwords, the business rule is that the text
area must contain a value if the value of the select is "true",
otherwis
n if the boolean select value happens to be
"true". So in otherwords, the business rule is that the text area must
contain a value if the value of the select is "true", otherwise, it can
be left blank. So I need conditional validation or field chaining.
I am assuming th
andle different page validations for
the same form.
Niall
- Original Message -
From: "Adam Lipscombe" <[EMAIL PROTECTED]>
To: "'Struts Users Mailing List'" <[EMAIL PROTECTED]>
Sent: Thursday, May 13, 2004 5:46 PM
Subject: RE: Newbie question: How
That did the trick. Many thanks!
-Original Message-
From: John Moore [mailto:[EMAIL PROTECTED]
Sent: 13 May 2004 17:58
To: Struts Users Mailing List
Subject: Re: Newbie question: How to implement conditional validation in an
ActionForm?
Adam Lipscombe wrote:
>
>Is there any
64 matches
Mail list logo