struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Marco Mistroni" <mmistr...@waersystems.com>
Subject RE: Validator question
Date Thu, 22 Apr 2004 15:45:45 GMT
Hi Hernan,
	Htanx for ur input, but I am still experiencing problems
Here is my validation.xml

<form name="destinationMaintenanceForm">
            <field property="destinationRef" depends="validwhen">
      		  <arg0 key="prompt.destinationRef"/>
        	  <msg name="validwhen"
                    key="error.field.required"/>
        	  <var>
                 <var-name>test</var-name>
                 <var-value>(buttonSelected == "find") and
((destinationRef == null) or (*this* != null))</var-value>
              </var> 
            </field>
            <field property="destinationName" depends="validwhen">
      		  <arg0 key="prompt.destinationName"/>
        	  <msg name="validwhen"
                    key="error.field.required"/>
        	  <var>
                 <var-name>test</var-name>
                 <var-value>(buttonSelected == "find") and
((destinationRef == null) or (*this* != null))</var-value>
              </var>
            </field>
          </form>

when I enter nothing in both fields, it seems that it does not validate
since the business logic is executed...

can you point me to what could be wrong in this file? Both fields need
to be
validated if the buttonSelected is equal to find and the other field is
empty...

thanx and regards
	marco



-----Original Message-----
From: hernans@epidataconsulting.com
[mailto:hernans@epidataconsulting.com] 
Sent: 22 April 2004 15:21
To: Struts Users Mailing List
Subject: Re: Validator question

In de Struts Validator guide, under the title "Conditionally required
fields" is an example of how to do conditional requirement.
http://jakarta.apache.org/struts/userGuide/dev_validator.html

Hope it helps
Hernan



> Hi all,
> 	I need help on struts validator.
> I have a form bean with two fields,and either one
> Or the other needs to be entered.
> How can I express, in validation.xml, that I want that either
> One field or the other is required?
>
> Thanx in advance and regards
> 	marco
>


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


Mime
View raw message