You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Heidy Gutiérrez Guzmán <he...@gmail.com> on 2006/09/15 02:24:15 UTC

required if validation doesn'nt work

I'm using " requiredif " validation from Validator Framework, but does'nt
work.

I have de rule in the validator-rules.xml and the method validateRequiredIf
exists in org.apache.struts.validator.FieldChecks in the struts jar.

I have read that requiredif is deprecated in struts 1.2, but that does'nt
problem for me, because i'm using struts 1.1

Re: required if validation doesn'nt work

Posted by Niall Pemberton <ni...@gmail.com>.
You have configured your validator using the format for the
"validwhen" validator - but specified the "requiredif" validator:

For the "requiredif" validator you need to use the following type of
configuration:
  http://struts.apache.org/1.2.x/userGuide/dev_validator.html#conditionals

For the "validwhen" validator:
  http://struts.apache.org/1.2.x/userGuide/dev_validator.html#validwhen

Niall

On 9/15/06, Heidy Gutiérrez Guzmán <he...@gmail.com> wrote:
> The validation always fails, i don't have any kind of exeption.
>
> The key in the application resources is ok for that kind of message.
>
> This is the code that i put in the validatir.xml
>
>                 <form name="gestionarEdicionMonitoresEDHEPForm">
>                         <field property="nombre" depends="requiredif">
>                                 <arg0 key="etiqueta.Nombre" />
>                                 <var>
>                                         <var-name>test</var-name>
>                                         <var-value>(campoOculto != null)</var-value>
>                                 </var>
>
>                         </field>
> </form>
>
> On 9/15/06, Niall Pemberton <ni...@gmail.com> wrote:
> > On 9/15/06, Heidy Gutiérrez Guzmán <he...@gmail.com> wrote:
> > > I'm using " requiredif " validation from Validator Framework, but does'nt
> > > work.
> > >
> > > I have de rule in the validator-rules.xml and the method
> > validateRequiredIf
> > > exists in org.apache.struts.validator.FieldChecks in the struts jar.
> > >
> > > I have read that requiredif is deprecated in struts 1.2, but that does'nt
> > > problem for me, because i'm using struts 1.1
> >
> > Just saying "it doesn't work" doesn't really give much information for
> > people to help you. Also its often useful to post the appropriate
> > "snippets" of your configuration files.
> >
> > Do you mean that validation always passes or fails or are you getting
> > some kind of exception? Have you checked the logs for any error
> > messages?
> >
> > Niall
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> > For additional commands, e-mail: user-help@struts.apache.org
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>

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


Re: required if validation doesn'nt work

Posted by Heidy Gutiérrez Guzmán <he...@gmail.com>.
The validation always fails, i don't have any kind of exeption.

The key in the application resources is ok for that kind of message.

This is the code that i put in the validatir.xml

		<form name="gestionarEdicionMonitoresEDHEPForm">
			<field property="nombre" depends="requiredif">
				<arg0 key="etiqueta.Nombre" />
				<var>
					<var-name>test</var-name>
					<var-value>(campoOculto != null)</var-value>
				</var>

			</field>
</form>

On 9/15/06, Niall Pemberton <ni...@gmail.com> wrote:
> On 9/15/06, Heidy Gutiérrez Guzmán <he...@gmail.com> wrote:
> > I'm using " requiredif " validation from Validator Framework, but does'nt
> > work.
> >
> > I have de rule in the validator-rules.xml and the method
> validateRequiredIf
> > exists in org.apache.struts.validator.FieldChecks in the struts jar.
> >
> > I have read that requiredif is deprecated in struts 1.2, but that does'nt
> > problem for me, because i'm using struts 1.1
>
> Just saying "it doesn't work" doesn't really give much information for
> people to help you. Also its often useful to post the appropriate
> "snippets" of your configuration files.
>
> Do you mean that validation always passes or fails or are you getting
> some kind of exception? Have you checked the logs for any error
> messages?
>
> Niall
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>

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


Re: required if validation doesn'nt work

Posted by Niall Pemberton <ni...@gmail.com>.
On 9/15/06, Heidy Gutiérrez Guzmán <he...@gmail.com> wrote:
> I'm using " requiredif " validation from Validator Framework, but does'nt
> work.
>
> I have de rule in the validator-rules.xml and the method validateRequiredIf
> exists in org.apache.struts.validator.FieldChecks in the struts jar.
>
> I have read that requiredif is deprecated in struts 1.2, but that does'nt
> problem for me, because i'm using struts 1.1

Just saying "it doesn't work" doesn't really give much information for
people to help you. Also its often useful to post the appropriate
"snippets" of your configuration files.

Do you mean that validation always passes or fails or are you getting
some kind of exception? Have you checked the logs for any error
messages?

Niall

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