struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Glenn Wilson" <gxwil...@hotmail.com>
Subject validwhen not working
Date Sun, 15 Apr 2007 14:34:40 GMT
Hi all, new to using validator. I have validator working on most of my 
applicaiton but having a problem doing a "validwhen". I've been using the 
examples in the "Jakarta Struts Cookbook".

Here is my question(s):

I've noticed that javascript code is generated unique to the form name. 
However, when I setup a "validwhen" for  the form no form specific 
javascript code gets generated. If I include "date" in the "depends" 
attribute I do get javascript code to do the date validation but nothing to 
deal with the validwhen?

So in my example, I have a page called Spiffs. The form name is SpiffsForm 
and I've included the <html:javascript formName="SpiffsForm" cdata="false"/> 
tag in the page. I have two date/text fields (startDate,endDate) which are 
optional however, when one is populated the other date field needs to be 
populated.

The validation.xml file reads

<form name="SpiffsForm">
<field property="spiffFilter.startDateAsString" depends="validwhen">
<arg key="spiffs.prompt.startDate" position="0"/>
      <var>
      <var-name>test</var-name>
      <var-value>((spiffFilter.endDateAsString == null) or (*this* != 
null))</var-value>
      </var>
</field>
<field property="spiffFilter.endDateAsString" depends="validwhen">
<arg key="spiffs.prompt.endDate" position="0"/>
      <var>
      <var-name>test</var-name>
      <var-value>((spiffFilter.startDateAsString == null) or (*this* != 
null))</var-value>
      </var>
</field>
</form>

I'm using Struts 1.3.5 with validator 1.3.0 on a Tomcat 5.5 instance.

Any help would be appreciated.
-Glenn

_________________________________________________________________
Mortgage rates near historic lows. Refinance $200,000 loan for as low as 
$771/month* 
https://www2.nextag.com/goto.jsp?product=100000035&url=%2fst.jsp&tm=y&search=mortgage_text_links_88_h27f8&disc=y&vers=689&s=4056&p=5117


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


Mime
View raw message